]> granicus.if.org Git - libvpx/commitdiff
Merge remote branch 'internal/upstream' into HEAD
authorJohn Koleszar <jkoleszar@google.com>
Tue, 14 Sep 2010 04:05:04 +0000 (00:05 -0400)
committerJohn Koleszar <jkoleszar@google.com>
Tue, 14 Sep 2010 04:05:04 +0000 (00:05 -0400)
configure
ivfenc.c
vp8/common/alloccommon.c
vp8/common/onyxc_int.h
vp8/vp8_cx_iface.c
vpx/vp8cx.h

index 5d6964e097d7bb529cfe2da81ce77f7515c09703..7751189b5e39a8ba01302e9c354d32acd7cd8ce0 100755 (executable)
--- a/configure
+++ b/configure
@@ -206,6 +206,8 @@ HAVE_LIST="
     pthread_h
     sys_mman_h
 "
+EXPERIMENT_LIST="
+"
 CONFIG_LIST="
     external_build
     install_docs
@@ -244,6 +246,9 @@ CONFIG_LIST="
     realtime_only
     shared
     arm_asm_detok
+
+    experimental
+    ${EXPERIMENT_LIST}
 "
 CMDLINE_SELECT="
     extra_warnings
@@ -281,6 +286,7 @@ CMDLINE_SELECT="
     realtime_only
     shared
     arm_asm_detok
+    experimental
 "
 
 process_cmdline() {
@@ -288,6 +294,18 @@ process_cmdline() {
         optval="${opt#*=}"
         case "$opt" in
         --disable-codecs) for c in ${CODECS}; do disable $c; done ;;
+        --enable-?*|--disable-?*)
+        eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
+        if echo "${EXPERIMENT_LIST}" | grep "^ *$option\$" >/dev/null; then
+            if enabled experimental; then
+                $action $option
+            else
+                log_echo "Ignoring $opt -- not in experimental mode."
+            fi
+        else
+            process_common_cmdline $opt
+        fi
+        ;;
         *) process_common_cmdline $opt
         ;;
         esac
index ad172927b9f498d9dbc73f8267de600058e0a196..de31cd2a2b3325590c403e4bab497a30dbe0c92e 100644 (file)
--- a/ivfenc.c
+++ b/ivfenc.c
@@ -30,6 +30,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #endif
+#include "vpx_config.h"
 #include "vpx/vp8cx.h"
 #include "vpx_ports/mem_ops.h"
 #include "vpx_ports/vpx_timer.h"
@@ -44,6 +45,9 @@ static const struct codec_item
     unsigned int             fourcc;
 } codecs[] =
 {
+#if CONFIG_EXPERIMENTAL && CONFIG_VP8_ENCODER
+    {"vp8x",  &vpx_codec_vp8x_cx_algo, 0x78385056},
+#endif
 #if CONFIG_VP8_ENCODER
     {"vp8",  &vpx_codec_vp8_cx_algo, 0x30385056},
 #endif
@@ -811,7 +815,11 @@ int main(int argc, const char **argv_)
     /* Handle codec specific options */
 #if CONFIG_VP8_ENCODER
 
-    if (codec->iface == &vpx_codec_vp8_cx_algo)
+    if (codec->iface == &vpx_codec_vp8_cx_algo
+#if CONFIG_EXPERIMENTAL
+        || codec->iface == &vpx_codec_vp8x_cx_algo
+#endif
+        )
     {
         ctrl_args = vp8_args;
         ctrl_args_map = vp8_arg_ctrl_map;
index 408c253068977a2c0ee6ee1dab7641270e37da15..2b96b757ed54fb6a8834ab5e640abe35b5c92eb2 100644 (file)
@@ -126,7 +126,16 @@ int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height)
 }
 void vp8_setup_version(VP8_COMMON *cm)
 {
-    switch (cm->version)
+    if (cm->version & 0x4)
+    {
+        if (!CONFIG_EXPERIMENTAL)
+            vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM,
+                               "Bitstream was created by an experimental "
+                               "encoder");        
+        cm->experimental = 1;
+    }
+    
+    switch (cm->version & 0x3)
     {
     case 0:
         cm->no_lpf = 0;
@@ -152,13 +161,6 @@ void vp8_setup_version(VP8_COMMON *cm)
         cm->use_bilinear_mc_filter = 1;
         cm->full_pixel = 1;
         break;
-    default:
-        //4,5,6,7 are reserved for future use
-        cm->no_lpf = 0;
-        cm->simpler_lpf = 0;
-        cm->use_bilinear_mc_filter = 0;
-        cm->full_pixel = 0;
-        break;
     }
 }
 void vp8_create_common(VP8_COMMON *oci)
index 132765d18542db51a882d668fcc7938c8b674167..d91e1f1ba25f2fee7559ebec8469e326a355df16 100644 (file)
@@ -116,6 +116,7 @@ typedef struct VP8Common
     int mode_info_stride;
 
     // prfile settings
+    int experimental;
     int mb_no_coeff_skip;
     int no_lpf;
     int simpler_lpf;
index 8845368fb21c4ab24359438602493b1e4bc1a8e4..11b87294659a8a3c2d0bb4a10fc2e080186c50b3 100644 (file)
@@ -36,7 +36,7 @@ struct vp8_extracfg
     unsigned int                arnr_max_frames;    /* alt_ref Noise Reduction Max Frame Count */
     unsigned int                arnr_strength;    /* alt_ref Noise Reduction Strength */
     unsigned int                arnr_type;        /* alt_ref filter type */
-
+    unsigned int                experimental;
 };
 
 struct extraconfig_map
@@ -66,6 +66,7 @@ static const struct extraconfig_map extracfg_map[] =
             0, /* arnr_max_frames */
             0, /* arnr_strength */
             0, /* arnr_type*/
+            0,                          /* experimental mode */
         }
     }
 };
@@ -233,7 +234,8 @@ static vpx_codec_err_t set_vp8e_config(VP8_CONFIG *oxcf,
                                        struct vp8_extracfg vp8_cfg)
 {
     oxcf->multi_threaded         = cfg.g_threads;
-    oxcf->Version               = cfg.g_profile;
+    oxcf->Version               = cfg.g_profile;    
+    oxcf->Version              |= vp8_cfg.experimental? 0x4 : 0;
 
     oxcf->Width                 = cfg.g_w;
     oxcf->Height                = cfg.g_h;
@@ -454,7 +456,10 @@ static vpx_codec_err_t set_param(vpx_codec_alg_priv_t *ctx,
     return res;
 #undef MAP
 }
-static vpx_codec_err_t vp8e_init(vpx_codec_ctx_t *ctx)
+
+
+static vpx_codec_err_t vp8e_common_init(vpx_codec_ctx_t *ctx,
+                                        int              experimental)
 {
     vpx_codec_err_t        res = VPX_DEC_OK;
     struct vpx_codec_alg_priv *priv;
@@ -496,6 +501,7 @@ static vpx_codec_err_t vp8e_init(vpx_codec_ctx_t *ctx)
 
             priv->vp8_cfg = extracfg_map[i].cfg;
             priv->vp8_cfg.pkt_list = &priv->pkt_list.head;
+            priv->vp8_cfg.experimental = experimental;
 
             priv->cx_data_sz = priv->cfg.g_w * priv->cfg.g_h * 3 / 2 * 2;
 
@@ -524,6 +530,21 @@ static vpx_codec_err_t vp8e_init(vpx_codec_ctx_t *ctx)
     return res;
 }
 
+
+static vpx_codec_err_t vp8e_init(vpx_codec_ctx_t *ctx)
+{
+    return vp8e_common_init(ctx, 0);
+}
+
+
+#if CONFIG_EXPERIMENTAL
+static vpx_codec_err_t vp8e_exp_init(vpx_codec_ctx_t *ctx)
+{
+    return vp8e_common_init(ctx, 1);
+}
+#endif
+
+
 static vpx_codec_err_t vp8e_destroy(vpx_codec_alg_priv_t *ctx)
 {
 
@@ -1102,6 +1123,36 @@ vpx_codec_iface_t vpx_codec_vp8_cx_algo =
 };
 
 
+#if CONFIG_EXPERIMENTAL
+vpx_codec_iface_t vpx_codec_vp8x_cx_algo =
+{
+    "VP8 Experimental Encoder" VERSION_STRING,
+    VPX_CODEC_INTERNAL_ABI_VERSION,
+    VPX_CODEC_CAP_ENCODER | VPX_CODEC_CAP_PSNR,
+    /* vpx_codec_caps_t          caps; */
+    vp8e_exp_init,      /* vpx_codec_init_fn_t       init; */
+    vp8e_destroy,       /* vpx_codec_destroy_fn_t    destroy; */
+    vp8e_ctf_maps,      /* vpx_codec_ctrl_fn_map_t  *ctrl_maps; */
+    NOT_IMPLEMENTED,    /* vpx_codec_get_mmap_fn_t   get_mmap; */
+    NOT_IMPLEMENTED,    /* vpx_codec_set_mmap_fn_t   set_mmap; */
+    {
+        NOT_IMPLEMENTED,    /* vpx_codec_peek_si_fn_t    peek_si; */
+        NOT_IMPLEMENTED,    /* vpx_codec_get_si_fn_t     get_si; */
+        NOT_IMPLEMENTED,    /* vpx_codec_decode_fn_t     decode; */
+        NOT_IMPLEMENTED,    /* vpx_codec_frame_get_fn_t  frame_get; */
+    },
+    {
+        vp8e_usage_cfg_map, /* vpx_codec_enc_cfg_map_t    peek_si; */
+        vp8e_encode,        /* vpx_codec_encode_fn_t      encode; */
+        vp8e_get_cxdata,    /* vpx_codec_get_cx_data_fn_t   frame_get; */
+        vp8e_set_config,
+        NOT_IMPLEMENTED,
+        vp8e_get_preview,
+    } /* encoder functions */
+};
+#endif
+
+
 /*
  * BEGIN BACKWARDS COMPATIBILITY SHIM.
  */
index e1c82114428c4d7985c0c7e8dfda8150b7daa423..00e40e0678a406e8482fe11c0e8ef9ca68b5a57c 100644 (file)
 extern vpx_codec_iface_t vpx_codec_vp8_cx_algo;
 
 
+#if CONFIG_EXPERIMENTAL
+/*!\brief Algorithm interface for VP8 experimental branch
+ *
+ * This interface provides the ability to encode using the "experimental"
+ * VP8 variant, which is bitstream incompatible with the default VP8 encoder.
+ */
+extern vpx_codec_iface_t vpx_codec_vp8x_cx_algo;
+#endif
+
+
 /*
  * Algorithm Flags
  */