Merge branch 'vp9-preview' of review:webm/libvpx
authorJohn Koleszar <jkoleszar@google.com>
Fri, 21 Dec 2012 23:20:41 +0000 (15:20 -0800)
committerJohn Koleszar <jkoleszar@google.com>
Thu, 27 Dec 2012 17:37:19 +0000 (09:37 -0800)
Merge the vp9-preview branch into master.

Change-Id: If700b9054676f24bed9deb59050af546c1ca5296

20 files changed:
1  2 
build/make/Android.mk
build/make/configure.sh
configure
libs.mk
test/idctllm_test.cc
test/intrapred_test.cc
test/pp_filter_test.cc
test/sad_test.cc
test/sixtap_predict_test.cc
test/subtract_test.cc
test/test.mk
vp8/decoder/threading.c
vp8/encoder/denoising.c
vp8/encoder/firstpass.c
vp8/encoder/onyx_if.c
vp8/encoder/rdopt.c
vp8/vp8cx.mk
vp8/vp8dx.mk
vpx/vpx_codec.h
vpxenc.c

Simple merge
Simple merge
diff --cc configure
Simple merge
diff --cc libs.mk
+++ b/libs.mk
@@@ -37,12 -70,12 +78,15 @@@ CODEC_SRCS-yes += $(addprefix vpx_mem/,
  include $(SRC_PATH_BARE)/vpx_scale/vpx_scale.mk
  CODEC_SRCS-yes += $(addprefix vpx_scale/,$(call enabled,SCALE_SRCS))
  
 +include $(SRC_PATH_BARE)/vpx_ports/vpx_ports.mk
 +CODEC_SRCS-yes += $(addprefix vpx_ports/,$(call enabled,PORTS_SRCS))
 +
+ ifneq ($(CONFIG_VP8_ENCODER)$(CONFIG_VP8_DECODER),)
+   VP8_PREFIX=vp8/
+   include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8_common.mk
+ endif
  
  ifeq ($(CONFIG_VP8_ENCODER),yes)
-   VP8_PREFIX=vp8/
    include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8cx.mk
    CODEC_SRCS-yes += $(addprefix $(VP8_PREFIX),$(call enabled,VP8_CX_SRCS))
    CODEC_EXPORTS-yes += $(addprefix $(VP8_PREFIX),$(VP8_CX_EXPORTS))
@@@ -89,10 -155,32 +161,13 @@@ INSTALL_MAPS += $(foreach p,$(VS_PLATFO
  INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/%  $(p)/Debug/%)
  endif
  
 -# If this is a universal (fat) binary, then all the subarchitectures have
 -# already been built and our job is to stitch them together. The
 -# BUILD_LIBVPX variable indicates whether we should be building
 -# (compiling, linking) the library. The LIPO_LIBVPX variable indicates
 -# that we're stitching.
 -$(eval $(if $(filter universal%,$(TOOLCHAIN)),LIPO_LIBVPX,BUILD_LIBVPX):=yes)
 -
  CODEC_SRCS-$(BUILD_LIBVPX) += build/make/version.sh
  CODEC_SRCS-$(BUILD_LIBVPX) += build/make/rtcd.sh
 -CODEC_SRCS-$(BUILD_LIBVPX) += vpx/vpx_integer.h
 -CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/asm_offsets.h
+ CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/emmintrin_compat.h
+ CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/vpx_once.h
 -CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/vpx_timer.h
 -CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/mem.h
  CODEC_SRCS-$(BUILD_LIBVPX) += $(BUILD_PFX)vpx_config.c
  INSTALL-SRCS-no += $(BUILD_PFX)vpx_config.c
 -ifeq ($(ARCH_X86)$(ARCH_X86_64),yes)
 -CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/emms.asm
 -CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/x86.h
 -CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/x86_abi_support.asm
+ CODEC_SRCS-$(BUILD_LIBVPX) += third_party/x86inc/x86inc.asm
 -CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/x86_cpuid.c
 -endif
 -CODEC_SRCS-$(ARCH_ARM) += vpx_ports/arm_cpudetect.c
 -CODEC_SRCS-$(ARCH_ARM) += vpx_ports/arm.h
  CODEC_EXPORTS-$(BUILD_LIBVPX) += vpx/exports_com
  CODEC_EXPORTS-$(CONFIG_ENCODERS) += vpx/exports_enc
  CODEC_EXPORTS-$(CONFIG_DECODERS) += vpx/exports_dec
@@@ -320,16 -377,10 +364,6 @@@ $(filter %$(ASM).o,$(OBJS-yes)): $(BUIL
  $(shell $(SRC_PATH_BARE)/build/make/version.sh "$(SRC_PATH_BARE)" $(BUILD_PFX)vpx_version.h)
  CLEAN-OBJS += $(BUILD_PFX)vpx_version.h
  
- #
- # Rule to generate runtime cpu detection files
- #
- $(BUILD_PFX)vpx_rtcd.h: $(SRC_PATH_BARE)/$(sort $(filter %rtcd_defs.sh,$(CODEC_SRCS)))
-       @echo "    [CREATE] $@"
-       $(qexec)$(SRC_PATH_BARE)/build/make/rtcd.sh --arch=$(TGT_ISA) \
-           --sym=vpx_rtcd \
-           --config=$(target)$(if $(FAT_ARCHS),,-$(TOOLCHAIN)).mk \
-           $(RTCD_OPTIONS) $^ > $@
- CLEAN-OBJS += $(BUILD_PFX)vpx_rtcd.h
 -CODEC_DOC_SRCS += vpx/vpx_codec.h \
 -                  vpx/vpx_decoder.h \
 -                  vpx/vpx_encoder.h \
 -                  vpx/vpx_image.h
  
  ##
  ## libvpx test directives
@@@ -11,9 -11,8 +11,9 @@@
  
  extern "C" {
  #include "vpx_config.h"
- #include "vpx_rtcd.h"
+ #include "vp8_rtcd.h"
  }
 +#include "test/register_state_check.h"
  #include "third_party/googletest/src/include/gtest/gtest.h"
  
  typedef void (*idct_fn_t)(short *input, unsigned char *pred_ptr,
Simple merge
Simple merge
Simple merge
Simple merge
  
  #include "third_party/googletest/src/include/gtest/gtest.h"
  #include "test/acm_random.h"
 +#include "test/register_state_check.h"
  extern "C" {
  #include "vpx_config.h"
- #include "vpx_rtcd.h"
+ #include "vp8_rtcd.h"
  #include "vp8/common/blockd.h"
  #include "vp8/encoder/block.h"
  #include "vpx_mem/vpx_mem.h"
diff --cc test/test.mk
@@@ -1,6 -1,6 +1,7 @@@
- LIBVPX_TEST_SRCS-yes += acm_random.h
 +LIBVPX_TEST_SRCS-yes += register_state_check.h
  LIBVPX_TEST_SRCS-yes += test.mk
+ LIBVPX_TEST_SRCS-yes += acm_random.h
  LIBVPX_TEST_SRCS-yes += test_libvpx.cc
  LIBVPX_TEST_SRCS-yes += util.h
  LIBVPX_TEST_SRCS-yes += video_source.h
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc vp8/vp8cx.mk
Simple merge
diff --cc vp8/vp8dx.mk
@@@ -18,34 -16,8 +16,10 @@@ VP8_DX_SRCS-no  += $(VP8_COMMON_SRCS-no
  VP8_DX_SRCS_REMOVE-yes += $(VP8_COMMON_SRCS_REMOVE-yes)
  VP8_DX_SRCS_REMOVE-no  += $(VP8_COMMON_SRCS_REMOVE-no)
  
 +VP8_DX_SRCS-yes += vp8dx.mk
 +
  VP8_DX_SRCS-yes += vp8_dx_iface.c
  
- # common
- #define ARM
- #define DISABLE_THREAD
- #INCLUDES += algo/vpx_common/vpx_mem/include
- #INCLUDES += common
- #INCLUDES += common
- #INCLUDES += common
- #INCLUDES += common
- #INCLUDES += decoder
- # decoder
- #define ARM
- #define DISABLE_THREAD
- #INCLUDES += algo/vpx_common/vpx_mem/include
- #INCLUDES += common
- #INCLUDES += common
- #INCLUDES += common
- #INCLUDES += common
- #INCLUDES += decoder
  VP8_DX_SRCS-yes += decoder/asm_dec_offsets.c
  VP8_DX_SRCS-yes += decoder/dboolhuff.c
  VP8_DX_SRCS-yes += decoder/decodemv.c
diff --cc vpx/vpx_codec.h
@@@ -49,24 -49,17 +49,24 @@@ extern "C" 
  #ifndef DEPRECATED
  #if defined(__GNUC__) && __GNUC__
  #define DEPRECATED          __attribute__ ((deprecated))
 -#define DECLSPEC_DEPRECATED /**< \copydoc #DEPRECATED */
  #elif defined(_MSC_VER)
  #define DEPRECATED
 -#define DECLSPEC_DEPRECATED __declspec(deprecated) /**< \copydoc #DEPRECATED */
  #else
  #define DEPRECATED
 -#define DECLSPEC_DEPRECATED /**< \copydoc #DEPRECATED */
  #endif
 +#endif  /* DEPRECATED */
 +
 +#ifndef DECLSPEC_DEPRECATED
 +#if defined(__GNUC__) && __GNUC__
 +#define DECLSPEC_DEPRECATED /**< \copydoc #DEPRECATED */
 +#elif defined(_MSC_VER)
 +#define DECLSPEC_DEPRECATED __declspec(deprecated) /**< \copydoc #DEPRECATED */
 +#else
 +#define DECLSPEC_DEPRECATED /**< \copydoc #DEPRECATED */
  #endif
 +#endif  /* DECLSPEC_DEPRECATED */
  
-     /*!\brief Decorator indicating a function is potentially unused */
+   /*!\brief Decorator indicating a function is potentially unused */
  #ifdef UNUSED
  #elif __GNUC__
  #define UNUSED __attribute__ ((unused))
diff --cc vpxenc.c
+++ b/vpxenc.c
@@@ -2220,100 -2231,94 +2231,95 @@@ static void update_quantizer_histogram(
  
  static void get_cx_data(struct stream_state  *stream,
                          struct global_config *global,
-                         int                  *got_data)
- {
-     const vpx_codec_cx_pkt_t *pkt;
-     const struct vpx_codec_enc_cfg *cfg = &stream->config.cfg;
-     vpx_codec_iter_t iter = NULL;
+                         int                  *got_data) {
+   const vpx_codec_cx_pkt_t *pkt;
+   const struct vpx_codec_enc_cfg *cfg = &stream->config.cfg;
+   vpx_codec_iter_t iter = NULL;
+   *got_data = 0;
+   while ((pkt = vpx_codec_get_cx_data(&stream->encoder, &iter))) {
+     static size_t fsize = 0;
+     static off_t ivf_header_pos = 0;
+     switch (pkt->kind) {
+       case VPX_CODEC_CX_FRAME_PKT:
+         if (!(pkt->data.frame.flags & VPX_FRAME_IS_FRAGMENT)) {
+           stream->frames_out++;
+         }
+         if (!global->quiet)
+           fprintf(stderr, " %6luF",
+                   (unsigned long)pkt->data.frame.sz);
+         update_rate_histogram(&stream->rate_hist, cfg, pkt);
+         if (stream->config.write_webm) {
+           /* Update the hash */
+           if (!stream->ebml.debug)
+             stream->hash = murmur(pkt->data.frame.buf,
+                                   (int)pkt->data.frame.sz,
+                                   stream->hash);
+           write_webm_block(&stream->ebml, cfg, pkt);
+         } else {
+           if (pkt->data.frame.partition_id <= 0) {
+             ivf_header_pos = ftello(stream->file);
+             fsize = pkt->data.frame.sz;
+             write_ivf_frame_header(stream->file, pkt);
+           } else {
+             fsize += pkt->data.frame.sz;
+             if (!(pkt->data.frame.flags & VPX_FRAME_IS_FRAGMENT)) {
+               off_t currpos = ftello(stream->file);
+               fseeko(stream->file, ivf_header_pos, SEEK_SET);
+               write_ivf_frame_size(stream->file, fsize);
+               fseeko(stream->file, currpos, SEEK_SET);
+             }
+           }
  
-     while ((pkt = vpx_codec_get_cx_data(&stream->encoder, &iter)))
-     {
-         static size_t fsize = 0;
-         static off_t ivf_header_pos = 0;
+           (void) fwrite(pkt->data.frame.buf, 1, pkt->data.frame.sz,
+                         stream->file);
+         }
+         stream->nbytes += pkt->data.raw.sz;
  
          *got_data = 1;
-         switch (pkt->kind)
-         {
-         case VPX_CODEC_CX_FRAME_PKT:
-             if (!(pkt->data.frame.flags & VPX_FRAME_IS_FRAGMENT))
-             {
-                 stream->frames_out++;
-             }
-             if (!global->quiet)
-                 fprintf(stderr, " %6luF",
-                         (unsigned long)pkt->data.frame.sz);
-             update_rate_histogram(&stream->rate_hist, cfg, pkt);
-             if(stream->config.write_webm)
-             {
-                 /* Update the hash */
-                 if(!stream->ebml.debug)
-                     stream->hash = murmur(pkt->data.frame.buf,
-                                           (int)pkt->data.frame.sz,
-                                           stream->hash);
-                 write_webm_block(&stream->ebml, cfg, pkt);
-             }
-             else
-             {
-                 if (pkt->data.frame.partition_id <= 0)
-                 {
-                     ivf_header_pos = ftello(stream->file);
-                     fsize = pkt->data.frame.sz;
-                     write_ivf_frame_header(stream->file, pkt);
-                 }
-                 else
-                 {
-                     fsize += pkt->data.frame.sz;
-                     if (!(pkt->data.frame.flags & VPX_FRAME_IS_FRAGMENT))
-                     {
-                         off_t currpos = ftello(stream->file);
-                         fseeko(stream->file, ivf_header_pos, SEEK_SET);
-                         write_ivf_frame_size(stream->file, fsize);
-                         fseeko(stream->file, currpos, SEEK_SET);
-                     }
-                 }
-                 (void) fwrite(pkt->data.frame.buf, 1, pkt->data.frame.sz,
-                               stream->file);
-             }
-             stream->nbytes += pkt->data.raw.sz;
-             break;
-         case VPX_CODEC_STATS_PKT:
-             stream->frames_out++;
+ #if CONFIG_DECODERS
+         if (global->test_decode) {
+           vpx_codec_decode(&stream->decoder, pkt->data.frame.buf,
+                            pkt->data.frame.sz, NULL, 0);
+           ctx_exit_on_error(&stream->decoder, "Failed to decode frame");
+         }
+ #endif
+         break;
+       case VPX_CODEC_STATS_PKT:
+         stream->frames_out++;
 -        fprintf(stderr, " %6luS",
 -                (unsigned long)pkt->data.twopass_stats.sz);
++        if (!global->quiet)
++          fprintf(stderr, " %6luS",
++                  (unsigned long)pkt->data.twopass_stats.sz);
+         stats_write(&stream->stats,
+                     pkt->data.twopass_stats.buf,
+                     pkt->data.twopass_stats.sz);
+         stream->nbytes += pkt->data.raw.sz;
+         break;
+       case VPX_CODEC_PSNR_PKT:
+         if (global->show_psnr) {
+           int i;
+           stream->psnr_sse_total += pkt->data.psnr.sse[0];
+           stream->psnr_samples_total += pkt->data.psnr.samples[0];
+           for (i = 0; i < 4; i++) {
              if (!global->quiet)
-                 fprintf(stderr, " %6luS",
-                        (unsigned long)pkt->data.twopass_stats.sz);
-             stats_write(&stream->stats,
-                         pkt->data.twopass_stats.buf,
-                         pkt->data.twopass_stats.sz);
-             stream->nbytes += pkt->data.raw.sz;
-             break;
-         case VPX_CODEC_PSNR_PKT:
-             if (global->show_psnr)
-             {
-                 int i;
-                 stream->psnr_sse_total += pkt->data.psnr.sse[0];
-                 stream->psnr_samples_total += pkt->data.psnr.samples[0];
-                 for (i = 0; i < 4; i++)
-                 {
-                     if (!global->quiet)
-                         fprintf(stderr, "%.3f ", pkt->data.psnr.psnr[i]);
-                     stream->psnr_totals[i] += pkt->data.psnr.psnr[i];
-                 }
-                 stream->psnr_count++;
-             }
-             break;
-         default:
-             break;
+               fprintf(stderr, "%.3f ", pkt->data.psnr.psnr[i]);
+             stream->psnr_totals[i] += pkt->data.psnr.psnr[i];
+           }
+           stream->psnr_count++;
          }
+         break;
+       default:
+         break;
      }
+   }
  }