[FFmpeg-cvslog] r25551 - in trunk/libavcodec: avcodec.h libvpxenc.c libx264.c options.c

cehoyos subversion
Fri Oct 22 20:09:14 CEST 2010


Author: cehoyos
Date: Fri Oct 22 20:09:14 2010
New Revision: 25551

Log:
Add new -slices option and use it for libvpx and libx264.

Patch by James Zern, jzern google

Modified:
   trunk/libavcodec/avcodec.h
   trunk/libavcodec/libvpxenc.c
   trunk/libavcodec/libx264.c
   trunk/libavcodec/options.c

Modified: trunk/libavcodec/avcodec.h
==============================================================================
--- trunk/libavcodec/avcodec.h	Fri Oct 22 20:01:48 2010	(r25550)
+++ trunk/libavcodec/avcodec.h	Fri Oct 22 20:09:14 2010	(r25551)
@@ -31,7 +31,7 @@
 #include "libavutil/cpu.h"
 
 #define LIBAVCODEC_VERSION_MAJOR 52
-#define LIBAVCODEC_VERSION_MINOR 92
+#define LIBAVCODEC_VERSION_MINOR 93
 #define LIBAVCODEC_VERSION_MICRO  0
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
@@ -2744,6 +2744,15 @@ typedef struct AVCodecContext {
      * - decoding: unused
      */
     int lpc_passes;
+
+    /**
+     * Number of slices.
+     * Indicates number of picture subdivisions. Used for parallelized
+     * decoding.
+     * - encoding: Set by user
+     * - decoding: unused
+     */
+    int slices;
 } AVCodecContext;
 
 /**

Modified: trunk/libavcodec/libvpxenc.c
==============================================================================
--- trunk/libavcodec/libvpxenc.c	Fri Oct 22 20:01:48 2010	(r25550)
+++ trunk/libavcodec/libvpxenc.c	Fri Oct 22 20:09:14 2010	(r25551)
@@ -310,6 +310,7 @@ static av_cold int vp8_init(AVCodecConte
     av_log(avctx, AV_LOG_DEBUG, "vpx_codec_control\n");
     codecctl_int(avctx, VP8E_SET_CPUUSED,           cpuused);
     codecctl_int(avctx, VP8E_SET_NOISE_SENSITIVITY, avctx->noise_reduction);
+    codecctl_int(avctx, VP8E_SET_TOKEN_PARTITIONS,  av_log2(avctx->slices));
 
     //provide dummy value to initialize wrapper, values will be updated each _encode()
     vpx_img_wrap(&ctx->rawimg, VPX_IMG_FMT_I420, avctx->width, avctx->height, 1,

Modified: trunk/libavcodec/libx264.c
==============================================================================
--- trunk/libavcodec/libx264.c	Fri Oct 22 20:01:48 2010	(r25550)
+++ trunk/libavcodec/libx264.c	Fri Oct 22 20:09:14 2010	(r25551)
@@ -294,6 +294,8 @@ static av_cold int X264_init(AVCodecCont
 
     x4->params.b_interlaced   = avctx->flags & CODEC_FLAG_INTERLACED_DCT;
 
+    x4->params.i_slice_count  = avctx->slices;
+
     if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER)
         x4->params.b_repeat_headers = 0;
 

Modified: trunk/libavcodec/options.c
==============================================================================
--- trunk/libavcodec/options.c	Fri Oct 22 20:01:48 2010	(r25550)
+++ trunk/libavcodec/options.c	Fri Oct 22 20:09:14 2010	(r25551)
@@ -425,6 +425,7 @@ static const AVOption options[]={
 {"levinson", NULL, 0, FF_OPT_TYPE_CONST, AV_LPC_TYPE_LEVINSON, INT_MIN, INT_MAX, A|E, "lpc_type"},
 {"cholesky", NULL, 0, FF_OPT_TYPE_CONST, AV_LPC_TYPE_CHOLESKY, INT_MIN, INT_MAX, A|E, "lpc_type"},
 {"lpc_passes", "number of passes to use for Cholesky factorization during LPC analysis", OFFSET(lpc_passes), FF_OPT_TYPE_INT, -1, INT_MIN, INT_MAX, A|E},
+{"slices", "number of slices, used in parallelized decoding", OFFSET(slices), FF_OPT_TYPE_INT, 0, 0, INT_MAX, V|E},
 {NULL},
 };
 



More information about the ffmpeg-cvslog mailing list