]> granicus.if.org Git - libvpx/commitdiff
Merge remote branch 'internal/upstream' into HEAD
authorJohn Koleszar <jkoleszar@google.com>
Sat, 25 Sep 2010 04:05:06 +0000 (00:05 -0400)
committerJohn Koleszar <jkoleszar@google.com>
Sat, 25 Sep 2010 04:05:06 +0000 (00:05 -0400)
14 files changed:
build/make/configure.sh
configure
vp8/decoder/onyxd_int.h
vp8/decoder/reconintra_mt.c [moved from vp8/common/reconintra_mt.c with 100% similarity]
vp8/decoder/threading.c
vp8/exports_dec
vp8/exports_enc
vp8/vp8_common.mk
vp8/vp8_cx_iface.c
vp8/vp8_dx_iface.c
vp8/vp8dx.mk
vpx/internal/vpx_codec_internal.h
vpx/vp8cx.h
vpx/vp8dx.h

index e787c5d2c591afe2376f97344db2a9537f0e206a..86759a97f69c3bf338fd505002b552130541d3c0 100755 (executable)
@@ -562,6 +562,9 @@ process_common_toolchain() {
     mips*)        enable mips;;
     esac
 
+    # PIC is probably what we want when building shared libs
+    enabled shared && soft_enable pic
+
     # Handle darwin variants
     case ${toolchain} in
         *-darwin8-gcc)
@@ -880,9 +883,9 @@ process_common_toolchain() {
     enabled gcov &&
         check_add_cflags -fprofile-arcs -ftest-coverage &&
         check_add_ldflags -fprofile-arcs -ftest-coverage
-    enabled optimizations && check_add_cflags -O3
-    if enabled rvct; then
-        enabled optimizations && check_add_cflags -Otime
+    if enabled optimizations; then
+        enabled rvct && check_add_cflags -Otime
+        enabled small && check_add_cflags -O2 || check_add_cflags -O3
     fi
 
     # Position Independant Code (PIC) support, for building relocatable
index 6fc26e4e779023866078efcd8c1fad43ebc8ebaf..19f672aedacac037258020f49d773f18ead9febf 100755 (executable)
--- a/configure
+++ b/configure
@@ -38,6 +38,7 @@ Advanced options:
   ${toggle_realtime_only}         enable this option while building for real-time encoding
   ${toggle_runtime_cpu_detect}    runtime cpu detection
   ${toggle_shared}                shared library support
+  ${toggle_small}                 favor smaller size over speed
   ${toggle_arm_asm_detok}         assembly version of the detokenizer (ARM platforms only)
 
 Codecs:
@@ -246,6 +247,7 @@ CONFIG_LIST="
     spatial_resampling
     realtime_only
     shared
+    small
     arm_asm_detok
 
     experimental
@@ -286,6 +288,7 @@ CMDLINE_SELECT="
     spatial_resampling
     realtime_only
     shared
+    small
     arm_asm_detok
     experimental
 "
index ab926e61d51910c3d5a184f59efe0242a308ea46..522ac22d2e22ee130e828cee8e4fd5294112aaf3 100644 (file)
@@ -96,6 +96,7 @@ typedef struct VP8Decompressor
     // variable for threading
 #if CONFIG_MULTITHREAD
     int mt_baseline_filter_level[MAX_MB_SEGMENTS];
+    int sync_range;
     int *mt_current_mb_col;                  // Each row remembers its already decoded column.
 
     unsigned char **mt_yabove_row;           // mb_rows x width
index 93bc69e724dacb45860ca0923531790d1e75eded..56dd5ef8e259043876483c7d678c7e2833fdea8d 100644 (file)
@@ -257,6 +257,7 @@ THREAD_FUNCTION vp8_thread_decoding_proc(void *p_data)
                 int mb_row;
                 int num_part = 1 << pbi->common.multi_token_partition;
                 volatile int *last_row_current_mb_col;
+                int nsync = pbi->sync_range;
 
                 for (mb_row = ithread+1; mb_row < pc->mb_rows; mb_row += (pbi->decoding_thread_count + 1))
                 {
@@ -292,9 +293,9 @@ THREAD_FUNCTION vp8_thread_decoding_proc(void *p_data)
 
                     for (mb_col = 0; mb_col < pc->mb_cols; mb_col++)
                     {
-                        if ((mb_col & 7) == 0)
+                        if ((mb_col & (nsync-1)) == 0)
                         {
-                            while (mb_col > (*last_row_current_mb_col - 8) && *last_row_current_mb_col != pc->mb_cols - 1)
+                            while (mb_col > (*last_row_current_mb_col - nsync) && *last_row_current_mb_col != pc->mb_cols - 1)
                             {
                                 x86_pause_hint();
                                 thread_sleep(0);
@@ -608,6 +609,11 @@ int vp8mt_alloc_temp_buffers(VP8D_COMP *pbi, int width, int prev_mb_rows)
         if ((width & 0xf) != 0)
             width += 16 - (width & 0xf);
 
+        if (width < 640) pbi->sync_range = 1;
+        else if (width <= 1280) pbi->sync_range = 8;
+        else if (width <= 2560) pbi->sync_range =16;
+        else pbi->sync_range = 32;
+
         uv_width = width >>1;
 
         // Allocate an int for each mb row.
@@ -764,6 +770,7 @@ void vp8mt_decode_mb_rows( VP8D_COMP *pbi, MACROBLOCKD *xd)
     int num_part = 1 << pbi->common.multi_token_partition;
     int i, j;
     volatile int *last_row_current_mb_col = NULL;
+    int nsync = pbi->sync_range;
 
     int filter_level;
     loop_filter_info *lfi = pc->lf_info;
@@ -832,8 +839,8 @@ void vp8mt_decode_mb_rows( VP8D_COMP *pbi, MACROBLOCKD *xd)
 
             for (mb_col = 0; mb_col < pc->mb_cols; mb_col++)
             {
-                if ( mb_row > 0 && (mb_col & 7) == 0){
-                    while (mb_col > (*last_row_current_mb_col - 8) && *last_row_current_mb_col != pc->mb_cols - 1)
+                if ( mb_row > 0 && (mb_col & (nsync-1)) == 0){
+                    while (mb_col > (*last_row_current_mb_col - nsync) && *last_row_current_mb_col != pc->mb_cols - 1)
                     {
                         x86_pause_hint();
                         thread_sleep(0);
index f9b985c8646f89d27668a0b28a9f8b2a304a8f3e..100ac5c27dcd537cff77b51d00c96c29e32ad6b6 100644 (file)
@@ -1 +1,2 @@
 data vpx_codec_vp8_dx_algo
+text vpx_codec_vp8_dx
index 99670111338c16a9231eecc9f62ef415f7f568c2..29ff35ef7bd5ddac5301d8e110d3513c235bd8e6 100644 (file)
@@ -1 +1,2 @@
 data vpx_codec_vp8_cx_algo
+text vpx_codec_vp8_cx
index b357b28bc408e4e4ab55e0b8156f3a5358aecf3b..ecca18a0a461d379918b975a5d3b9516a74538ec 100644 (file)
@@ -81,8 +81,6 @@ VP8_COMMON_SRCS-yes += common/recon.c
 VP8_COMMON_SRCS-yes += common/reconinter.c
 VP8_COMMON_SRCS-yes += common/reconintra.c
 VP8_COMMON_SRCS-yes += common/reconintra4x4.c
-VP8_COMMON_SRCS-yes += common/reconintra_mt.h
-VP8_COMMON_SRCS-yes += common/reconintra_mt.c
 VP8_COMMON_SRCS-yes += common/setupintrarecon.c
 VP8_COMMON_SRCS-yes += common/swapyv12buffer.c
 VP8_COMMON_SRCS-yes += common/textblit.c
index 52f3938b9e6f10598f3f6716bb9a7f949f2f8d64..cf2b1ff38af09120a633b07287a1d1757732d100 100644 (file)
@@ -1100,7 +1100,7 @@ static vpx_codec_enc_cfg_map_t vp8e_usage_cfg_map[] =
 #ifndef VERSION_STRING
 #define VERSION_STRING
 #endif
-vpx_codec_iface_t vpx_codec_vp8_cx_algo =
+CODEC_INTERFACE(vpx_codec_vp8_cx) =
 {
     "WebM Project VP8 Encoder" VERSION_STRING,
     VPX_CODEC_INTERNAL_ABI_VERSION,
index e7e535638819c837ea9d6b997ef8b9e51f1e012d..f19cb9a30d68c9a24bacdc994a9d0da879ac0714 100644 (file)
@@ -653,7 +653,7 @@ vpx_codec_ctrl_fn_map_t vp8_ctf_maps[] =
 #ifndef VERSION_STRING
 #define VERSION_STRING
 #endif
-vpx_codec_iface_t vpx_codec_vp8_dx_algo =
+CODEC_INTERFACE(vpx_codec_vp8_dx) =
 {
     "WebM Project VP8 Decoder" VERSION_STRING,
     VPX_CODEC_INTERNAL_ABI_VERSION,
index 94196170833789d30c241825e606e89010ff5070..1acd67453505475c58ac2fe92c66b0b556e72e9e 100644 (file)
@@ -67,6 +67,8 @@ VP8_DX_SRCS-yes += decoder/treereader.h
 VP8_DX_SRCS-yes += decoder/onyxd_if.c
 VP8_DX_SRCS-yes += decoder/threading.c
 VP8_DX_SRCS-yes += decoder/idct_blk.c
+VP8_DX_SRCS-$(CONFIG_MULTITHREAD) += decoder/reconintra_mt.h
+VP8_DX_SRCS-$(CONFIG_MULTITHREAD) += decoder/reconintra_mt.c
 
 VP8_DX_SRCS-yes := $(filter-out $(VP8_DX_SRCS_REMOVE-yes),$(VP8_DX_SRCS-yes))
 
index ab4cad10c7294fae6b4d7adbc24cabbb796edf0a..dcb451dca17fe055031b5ddfff620c70743f3263 100644 (file)
@@ -389,6 +389,20 @@ struct vpx_codec_priv
 #define RECAST(id, x) id##__convert(x)
 
 
+/* CODEC_INTERFACE convenience macro
+ *
+ * By convention, each codec interface is a struct with extern linkage, where
+ * the symbol is suffixed with _algo. A getter function is also defined to
+ * return a pointer to the struct, since in some cases it's easier to work
+ * with text symbols than data symbols (see issue #169). This function has
+ * the same name as the struct, less the _algo suffix. The CODEC_INTERFACE
+ * macro is provided to define this getter function automatically.
+ */
+#define CODEC_INTERFACE(id)\
+vpx_codec_iface_t* id(void) { return &id##_algo; }\
+vpx_codec_iface_t  id##_algo
+
+
 /* Internal Utility Functions
  *
  * The following functions are indended to be used inside algorithms as
index 00e40e0678a406e8482fe11c0e8ef9ca68b5a57c..5ab6fbfb7edc700b7975aa2065cb4944975ec3ba 100644 (file)
@@ -29,7 +29,8 @@
  * This interface provides the capability to encode raw VP8 streams, as would
  * be found in AVI files.
  */
-extern vpx_codec_iface_t vpx_codec_vp8_cx_algo;
+extern vpx_codec_iface_t  vpx_codec_vp8_cx_algo;
+extern vpx_codec_iface_t* vpx_codec_vp8_cx(void);
 
 
 #if CONFIG_EXPERIMENTAL
index 4cad838ffbe71534f1968abb2ebb4728524aa789..fccd407f33d54bca8faaf2e99a8a36679a631015 100644 (file)
@@ -29,7 +29,8 @@
  * This interface provides the capability to decode raw VP8 streams, as would
  * be found in AVI files and other non-Flash uses.
  */
-extern vpx_codec_iface_t vpx_codec_vp8_dx_algo;
+extern vpx_codec_iface_t  vpx_codec_vp8_dx_algo;
+extern vpx_codec_iface_t* vpx_codec_vp8_dx(void);
 
 /* Include controls common to both the encoder and decoder */
 #include "vp8.h"