Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@users.sourceforge.net>2010-08-15 23:24:37 +0400
committerXhmikosR <xhmikosr@users.sourceforge.net>2010-08-15 23:24:37 +0400
commitfbc0947d00907c604b95aea34314030f404b7319 (patch)
tree5e9aba6a9efffba2cc1db3528b20a0d4c5460291 /src/filters/transform
parent2b9ed578ede7ebd6a3417aa886cf5e1fc70d4e5c (diff)
updated ffmpeg
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@2247 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/transform')
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/Makefile4
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/config.h9
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/avcodec.h26
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/h264_cavlc.c47
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/imgconvert.c84
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/imgconvert.h3
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vp56.h10
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vp56rac.c4
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vp8.c37
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/h264dsp_mmx.c2
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/vp56_arith.h2
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcore/avcore_utils.c86
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcore/imgutils.c24
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcore/imgutils.h8
14 files changed, 193 insertions, 153 deletions
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/Makefile b/src/filters/transform/MPCVideoDec/ffmpeg/Makefile
index 012e5cc30..7c1807620 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/Makefile
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/Makefile
@@ -1,8 +1,8 @@
LAVC_DIR = libavcodec
-LAVCORE_DIR=libavcore
+LAVCORE_DIR = libavcore
LAVU_DIR = libavutil
LSWS_DIR = libswscale
-PNG_DIR = ../../../../thirdparty/libpng
+PNG_DIR = ../../../../thirdparty/libpng
ZLIB_DIR = ../../../../thirdparty/zlib
ifeq ($(64BIT),yes)
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/config.h b/src/filters/transform/MPCVideoDec/ffmpeg/config.h
index 5c7f1ed3a..d3b203c61 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/config.h
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/config.h
@@ -116,10 +116,13 @@
#define CONFIG_DCT 0
#define CONFIG_DWT 0
-#define CONFIG_HARDCODED_TABLES 0
+
#define CONFIG_GPL 1
#define CONFIG_GRAY 1
+#define CONFIG_H264PRED 1
#define CONFIG_H264DSP 1
+#define CONFIG_HARDCODED_TABLES 0
+#define CONFIG_HUFFMAN 0
#define CONFIG_LIBAMR_NB 1
#define CONFIG_LIBXVID 0
#define CONFIG_LPC 0
@@ -130,10 +133,10 @@
#define CONFIG_DECODERS 1
#define CONFIG_ENCODERS 0
-#define CONFIG_SWSCALE 1
-#define CONFIG_SWSCALE_ALPHA 1
#define CONFIG_POSTPROC 0
#define CONFIG_RUNTIME_CPUDETECT 1
+#define CONFIG_SWSCALE 1
+#define CONFIG_SWSCALE_ALPHA 1
/*
Note: when adding a new codec, you have to:
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/avcodec.h b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/avcodec.h
index 40fed9b13..a841de108 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/avcodec.h
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/avcodec.h
@@ -44,8 +44,8 @@
#include "libavutil/avutil.h"
#define LIBAVCODEC_VERSION_MAJOR 52
-#define LIBAVCODEC_VERSION_MINOR 84
-#define LIBAVCODEC_VERSION_MICRO 0
+#define LIBAVCODEC_VERSION_MINOR 85
+#define LIBAVCODEC_VERSION_MICRO 1
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
@@ -61,16 +61,6 @@
#define AV_TIME_BASE 1000000
static const AVRational AV_TIME_BASE_Q={1, AV_TIME_BASE};
-enum CodecType {
- CODEC_TYPE_UNKNOWN = -1,
- CODEC_TYPE_VIDEO,
- CODEC_TYPE_AUDIO,
- CODEC_TYPE_DATA,
- CODEC_TYPE_SUBTITLE,
- CODEC_TYPE_ATTACHMENT,
- CODEC_TYPE_NB
-};
-
#if LIBAVCODEC_VERSION_MAJOR < 53
#define CodecType AVMediaType
@@ -3253,7 +3243,17 @@ void av_fast_malloc(void *ptr, unsigned int *size, unsigned int min_size);
attribute_deprecated void av_free_static(void);
/**
- * Copy image 'src' to 'dst'.
+ * Copy image data in src_data to dst_data.
+ *
+ * @param dst_linesize linesizes for the image in dst_data
+ * @param src_linesize linesizes for the image in src_data
+ */
+void av_picture_data_copy(uint8_t *dst_data[4], int dst_linesize[4],
+ uint8_t *src_data[4], int src_linesize[4],
+ enum PixelFormat pix_fmt, int width, int height);
+
+/**
+ * Copy image src to dst. Wraps av_picture_data_copy() above.
*/
void av_picture_copy(AVPicture *dst, const AVPicture *src,
enum PixelFormat pix_fmt, int width, int height);
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/h264_cavlc.c b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/h264_cavlc.c
index 4f8d12078..860113771 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/h264_cavlc.c
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/h264_cavlc.c
@@ -367,7 +367,7 @@ static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, in
MpegEncContext * const s = &h->s;
static const int coeff_token_table_index[17]= {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3};
int level[16];
- int zeros_left, coeff_num, coeff_token, total_coeff, i, j, trailing_ones, run_before;
+ int zeros_left, coeff_token, total_coeff, i, trailing_ones, run_before;
//FIXME put trailing_onex into the context
@@ -488,39 +488,36 @@ static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, in
zeros_left= get_vlc2(gb, (total_zeros_vlc-1)[ total_coeff ].table, TOTAL_ZEROS_VLC_BITS, 1);
}
- coeff_num = zeros_left + total_coeff - 1;
- j = scantable[coeff_num];
+ scantable += zeros_left + total_coeff - 1;
if(n > 24){
- block[j] = level[0];
- for(i=1;i<total_coeff;i++) {
- if(zeros_left <= 0)
- run_before = 0;
- else if(zeros_left < 7){
+ block[*scantable] = level[0];
+ for(i=1;i<total_coeff && zeros_left > 0;i++) {
+ if(zeros_left < 7)
run_before= get_vlc2(gb, (run_vlc-1)[zeros_left].table, RUN_VLC_BITS, 1);
- }else{
+ else
run_before= get_vlc2(gb, run7_vlc.table, RUN7_VLC_BITS, 2);
- }
zeros_left -= run_before;
- coeff_num -= 1 + run_before;
- j= scantable[ coeff_num ];
-
- block[j]= level[i];
+ scantable -= 1 + run_before;
+ block[*scantable]= level[i];
+ }
+ for(;i<total_coeff;i++) {
+ scantable--;
+ block[*scantable]= level[i];
}
}else{
- block[j] = (level[0] * qmul[j] + 32)>>6;
- for(i=1;i<total_coeff;i++) {
- if(zeros_left <= 0)
- run_before = 0;
- else if(zeros_left < 7){
+ block[*scantable] = (level[0] * qmul[*scantable] + 32)>>6;
+ for(i=1;i<total_coeff && zeros_left > 0;i++) {
+ if(zeros_left < 7)
run_before= get_vlc2(gb, (run_vlc-1)[zeros_left].table, RUN_VLC_BITS, 1);
- }else{
+ else
run_before= get_vlc2(gb, run7_vlc.table, RUN7_VLC_BITS, 2);
- }
zeros_left -= run_before;
- coeff_num -= 1 + run_before;
- j= scantable[ coeff_num ];
-
- block[j]= (level[i] * qmul[j] + 32)>>6;
+ scantable -= 1 + run_before;
+ block[*scantable]= (level[i] * qmul[*scantable] + 32)>>6;
+ }
+ for(;i<total_coeff;i++) {
+ scantable--;
+ block[*scantable]= (level[i] * qmul[*scantable] + 32)>>6;
}
}
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/imgconvert.c b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/imgconvert.c
index 293fa3c8a..f6ea7a7f1 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/imgconvert.c
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/imgconvert.c
@@ -761,23 +761,10 @@ int ff_fill_pointer(AVPicture *picture, uint8_t *ptr, enum PixelFormat pix_fmt,
}
#endif
-void ff_img_copy_plane(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
-{
- if((!dst) || (!src))
- return;
- for(;height > 0; height--) {
- memcpy(dst, src, width);
- dst += dst_wrap;
- src += src_wrap;
- }
-}
-
-int ff_get_plane_bytewidth(enum PixelFormat pix_fmt, int width, int plane)
+static int avg_bits_per_pixel(enum PixelFormat pix_fmt)
{
int bits;
- const PixFmtInfo *pf = &pix_fmt_info[pix_fmt];
+ const PixFmtInfo *pf;
const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];
pf = &pix_fmt_info[pix_fmt];
@@ -807,26 +794,48 @@ int ff_get_plane_bytewidth(enum PixelFormat pix_fmt, int width, int plane)
bits = pf->depth * pf->nb_channels;
break;
}
- return (width * bits + 7) >> 3;
break;
case FF_PIXEL_PLANAR:
- if ((pix_fmt != PIX_FMT_NV12 && pix_fmt != PIX_FMT_NV21) &&
- (plane == 1 || plane == 2))
- width= -((-width)>>desc->log2_chroma_w);
-
- return (width * pf->depth + 7) >> 3;
+ if (desc->log2_chroma_w == 0 && desc->log2_chroma_h == 0) {
+ bits = pf->depth * pf->nb_channels;
+ } else {
+ bits = pf->depth + ((2 * pf->depth) >>
+ (desc->log2_chroma_w + desc->log2_chroma_h));
+ }
break;
case FF_PIXEL_PALETTE:
- if (plane == 0)
- return width;
+ bits = 8;
+ break;
+ default:
+ bits = -1;
break;
}
+ return bits;
+}
+
+void ff_img_copy_plane(uint8_t *dst, int dst_wrap,
+ const uint8_t *src, int src_wrap,
+ int width, int height)
+{
+ if((!dst) || (!src))
+ return;
+ for(;height > 0; height--) {
+ memcpy(dst, src, width);
+ dst += dst_wrap;
+ src += src_wrap;
+ }
+}
- return -1;
+#if LIBAVCODEC_VERSION_MAJOR < 53
+int ff_get_plane_bytewidth(enum PixelFormat pix_fmt, int width, int plane)
+{
+ return av_get_image_linesize(pix_fmt, width, plane);
}
+#endif
-void av_picture_copy(AVPicture *dst, const AVPicture *src,
- enum PixelFormat pix_fmt, int width, int height)
+void av_picture_data_copy(uint8_t *dst_data[4], int dst_linesize[4],
+ uint8_t *src_data[4], int src_linesize[4],
+ enum PixelFormat pix_fmt, int width, int height)
{
int i;
const PixFmtInfo *pf = &pix_fmt_info[pix_fmt];
@@ -837,26 +846,33 @@ void av_picture_copy(AVPicture *dst, const AVPicture *src,
case FF_PIXEL_PLANAR:
for(i = 0; i < pf->nb_channels; i++) {
int h;
- int bwidth = ff_get_plane_bytewidth(pix_fmt, width, i);
+ int bwidth = av_get_image_linesize(pix_fmt, width, i);
h = height;
if (i == 1 || i == 2) {
h= -((-height)>>desc->log2_chroma_h);
}
- ff_img_copy_plane(dst->data[i], dst->linesize[i],
- src->data[i], src->linesize[i],
- bwidth, h);
+ ff_img_copy_plane(dst_data[i], dst_linesize[i],
+ src_data[i], src_linesize[i],
+ bwidth, h);
}
break;
case FF_PIXEL_PALETTE:
- ff_img_copy_plane(dst->data[0], dst->linesize[0],
- src->data[0], src->linesize[0],
- width, height);
+ ff_img_copy_plane(dst_data[0], dst_linesize[0],
+ src_data[0], src_linesize[0],
+ width, height);
/* copy the palette */
- memcpy(dst->data[1], src->data[1], 4*256);
+ memcpy(dst_data[1], src_data[1], 4*256);
break;
}
}
+void av_picture_copy(AVPicture *dst, const AVPicture *src,
+ enum PixelFormat pix_fmt, int width, int height)
+{
+ av_picture_data_copy(dst->data, dst->linesize, src->data,
+ src->linesize, pix_fmt, width, height);
+}
+
/* 2x2 -> 1x1 */
void ff_shrink22(uint8_t *dst, int dst_wrap,
const uint8_t *src, int src_wrap,
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/imgconvert.h b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/imgconvert.h
index f09fcbfc0..0f2c2e171 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/imgconvert.h
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/imgconvert.h
@@ -33,9 +33,10 @@ int ff_fill_linesize(AVPicture *picture, enum PixelFormat pix_fmt, int width);
attribute_deprecated
int ff_fill_pointer(AVPicture *picture, uint8_t *ptr, enum PixelFormat pix_fmt, int height);
-#endif
+attribute_deprecated
int ff_get_plane_bytewidth(enum PixelFormat pix_fmt, int width, int plane);
+#endif
int ff_set_systematic_pal(uint32_t pal[256], enum PixelFormat pix_fmt);
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vp56.h b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vp56.h
index f3e0abdd7..f9500cfb5 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vp56.h
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vp56.h
@@ -194,8 +194,8 @@ static av_always_inline unsigned int vp56_rac_renorm(VP56RangeCoder *c)
code_word <<= shift;
bits += shift;
if(bits >= 0 && c->buffer < c->end) {
- code_word |= *c->buffer++ << bits;
- bits -= 8;
+ code_word |= bytestream_get_be16(&c->buffer) << bits;
+ bits -= 16;
}
c->bits = bits;
return code_word;
@@ -211,7 +211,7 @@ static av_always_inline int vp56_rac_get_prob(VP56RangeCoder *c, uint8_t prob)
{
unsigned int code_word = vp56_rac_renorm(c);
unsigned int low = 1 + (((c->high - 1) * prob) >> 8);
- unsigned int low_shift = low << 8;
+ unsigned int low_shift = low << 16;
int bit = code_word >= low_shift;
c->high = bit ? c->high - low : low;
@@ -226,7 +226,7 @@ static av_always_inline int vp56_rac_get_prob_branchy(VP56RangeCoder *c, int pro
{
unsigned long code_word = vp56_rac_renorm(c);
unsigned low = 1 + (((c->high - 1) * prob) >> 8);
- unsigned low_shift = low << 8;
+ unsigned low_shift = low << 16;
if (code_word >= low_shift) {
c->high -= low;
@@ -244,7 +244,7 @@ static av_always_inline int vp56_rac_get(VP56RangeCoder *c)
unsigned int code_word = vp56_rac_renorm(c);
/* equiprobable */
int low = (c->high + 1) >> 1;
- unsigned int low_shift = low << 8;
+ unsigned int low_shift = low << 16;
int bit = code_word >= low_shift;
if (bit) {
c->high -= low;
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vp56rac.c b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vp56rac.c
index 752a42bc6..f11531de2 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vp56rac.c
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vp56rac.c
@@ -40,8 +40,8 @@ const uint8_t ff_vp56_norm_shift[256]= {
void ff_vp56_init_range_decoder(VP56RangeCoder *c, const uint8_t *buf, int buf_size)
{
c->high = 255;
- c->bits = -8;
+ c->bits = -16;
c->buffer = buf;
c->end = buf + buf_size;
- c->code_word = bytestream_get_be16(&c->buffer);
+ c->code_word = bytestream_get_be24(&c->buffer);
}
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vp8.c b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vp8.c
index 1cfea612b..d8d7cdaa2 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vp8.c
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vp8.c
@@ -87,12 +87,10 @@ typedef struct {
VP8Macroblock *macroblocks;
VP8Macroblock *macroblocks_base;
VP8FilterStrength *filter_strength;
- int mb_stride;
uint8_t *intra4x4_pred_mode_top;
uint8_t intra4x4_pred_mode_left[4];
uint8_t *segmentation_map;
- int b4_stride;
/**
* Cache of the top row needed for intra prediction
@@ -235,17 +233,12 @@ static int update_dimensions(VP8Context *s, int width, int height)
s->mb_width = (s->avctx->coded_width +15) / 16;
s->mb_height = (s->avctx->coded_height+15) / 16;
- // we allocate a border around the top/left of intra4x4 modes
- // this is 4 blocks for intra4x4 to keep 4-byte alignment for fill_rectangle
- s->mb_stride = s->mb_width+1;
- s->b4_stride = 4*s->mb_stride;
-
- s->macroblocks_base = av_mallocz((s->mb_stride+s->mb_height*2+2)*sizeof(*s->macroblocks));
- s->filter_strength = av_mallocz(s->mb_stride*sizeof(*s->filter_strength));
- s->intra4x4_pred_mode_top = av_mallocz(s->b4_stride*4);
+ s->macroblocks_base = av_mallocz((s->mb_width+s->mb_height*2+1)*sizeof(*s->macroblocks));
+ s->filter_strength = av_mallocz(s->mb_width*sizeof(*s->filter_strength));
+ s->intra4x4_pred_mode_top = av_mallocz(s->mb_width*4);
s->top_nnz = av_mallocz(s->mb_width*sizeof(*s->top_nnz));
s->top_border = av_mallocz((s->mb_width+1)*sizeof(*s->top_border));
- s->segmentation_map = av_mallocz(s->mb_stride*s->mb_height);
+ s->segmentation_map = av_mallocz(s->mb_width*s->mb_height);
if (!s->macroblocks_base || !s->filter_strength || !s->intra4x4_pred_mode_top ||
!s->top_nnz || !s->top_border || !s->segmentation_map)
@@ -535,7 +528,7 @@ void clamp_mv(VP8Context *s, VP56mv *dst, const VP56mv *src, int mb_x, int mb_y)
}
static av_always_inline
-void find_near_mvs(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y,
+void find_near_mvs(VP8Context *s, VP8Macroblock *mb,
VP56mv near[2], VP56mv *best, uint8_t cnt[4])
{
VP8Macroblock *mb_edge[3] = { mb + 2 /* top */,
@@ -767,7 +760,7 @@ void decode_mb_mode(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, uint8_
s->ref_count[mb->ref_frame-1]++;
// motion vectors, 16.3
- find_near_mvs(s, mb, mb_x, mb_y, near, &best, cnt);
+ find_near_mvs(s, mb, near, &best, cnt);
if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[0]][0])) {
if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[1]][1])) {
if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[2]][2])) {
@@ -778,8 +771,8 @@ void decode_mb_mode(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, uint8_
} else {
mb->mode = VP8_MVMODE_NEW;
clamp_mv(s, &mb->mv, &mb->mv, mb_x, mb_y);
- mb->mv.y += + read_mv_component(c, s->prob->mvc[0]);
- mb->mv.x += + read_mv_component(c, s->prob->mvc[1]);
+ mb->mv.y += read_mv_component(c, s->prob->mvc[0]);
+ mb->mv.x += read_mv_component(c, s->prob->mvc[1]);
}
} else {
mb->mode = VP8_MVMODE_NEAR;
@@ -1536,26 +1529,26 @@ static int vp8_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
memset(s->top_nnz, 0, s->mb_width*sizeof(*s->top_nnz));
- /* Zero macroblock structures for top/left prediction from outside the frame. */
- memset(s->macroblocks, 0, (s->mb_width + s->mb_height*2)*sizeof(*s->macroblocks));
+ /* Zero macroblock structures for top/top-left prediction from outside the frame. */
+ memset(s->macroblocks + s->mb_height*2 - 1, 0, (s->mb_width+1)*sizeof(*s->macroblocks));
// top edge of 127 for intra prediction
memset(s->top_border, 127, (s->mb_width+1)*sizeof(*s->top_border));
memset(s->ref_count, 0, sizeof(s->ref_count));
if (s->keyframe)
- memset(s->intra4x4_pred_mode_top, DC_PRED, s->b4_stride*4);
+ memset(s->intra4x4_pred_mode_top, DC_PRED, s->mb_width*4);
for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
VP56RangeCoder *c = &s->coeff_partition[mb_y & (s->num_coeff_partitions-1)];
VP8Macroblock *mb = s->macroblocks + (s->mb_height - mb_y - 1)*2;
- uint8_t *segment_map = s->segmentation_map + mb_y*s->mb_stride;
- int mb_xy = mb_y * s->mb_stride;
+ int mb_xy = mb_y*s->mb_width;
uint8_t *dst[3] = {
curframe->data[0] + 16*mb_y*s->linesize,
curframe->data[1] + 8*mb_y*s->uvlinesize,
curframe->data[2] + 8*mb_y*s->uvlinesize
};
+ memset(mb - 1, 0, sizeof(*mb)); // zero left macroblock
memset(s->left_nnz, 0, sizeof(s->left_nnz));
AV_WN32A(s->intra4x4_pred_mode_left, DC_PRED*0x01010101);
@@ -1568,13 +1561,11 @@ static int vp8_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
memset(s->top_border, 129, sizeof(*s->top_border));
for (mb_x = 0; mb_x < s->mb_width; mb_x++, mb_xy++, mb++) {
- uint8_t *segment_mb = segment_map+mb_x;
-
/* Prefetch the current frame, 4 MBs ahead */
s->dsp.prefetch(dst[0] + (mb_x&3)*4*s->linesize + 64, s->linesize, 4);
s->dsp.prefetch(dst[1] + (mb_x&7)*s->uvlinesize + 64, dst[2] - dst[1], 2);
- decode_mb_mode(s, mb, mb_x, mb_y, segment_mb);
+ decode_mb_mode(s, mb, mb_x, mb_y, s->segmentation_map + mb_xy);
prefetch_motion(s, mb, mb_x, mb_y, mb_xy, VP56_FRAME_PREVIOUS);
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/h264dsp_mmx.c b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/h264dsp_mmx.c
index 1dd5874ab..35a016b2f 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/h264dsp_mmx.c
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/h264dsp_mmx.c
@@ -2365,7 +2365,7 @@ void ff_pred4x4_tm_vp8_mmxext (uint8_t *src, const uint8_t *topright, int s
void ff_pred4x4_tm_vp8_ssse3 (uint8_t *src, const uint8_t *topright, int stride);
void ff_pred4x4_vertical_vp8_mmxext(uint8_t *src, const uint8_t *topright, int stride);
-#if CONFIG_H264DSP
+#if CONFIG_H264PRED
void ff_h264_pred_init_x86(H264PredContext *h, int codec_id)
{
mm_flags = mm_support();
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/vp56_arith.h b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/vp56_arith.h
index ae3bc3dc7..ddbf38b1a 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/vp56_arith.h
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/x86/vp56_arith.h
@@ -31,7 +31,7 @@ static av_always_inline int vp56_rac_get_prob(VP56RangeCoder *c, uint8_t prob)
unsigned int code_word = vp56_rac_renorm(c);
unsigned int high = c->high;
unsigned int low = 1 + (((high - 1) * prob) >> 8);
- unsigned int low_shift = low << 8;
+ unsigned int low_shift = low << 16;
int bit = 0;
__asm__(
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcore/avcore_utils.c b/src/filters/transform/MPCVideoDec/ffmpeg/libavcore/avcore_utils.c
index badb9ee36..a253b9d28 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcore/avcore_utils.c
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcore/avcore_utils.c
@@ -1,43 +1,43 @@
-/*
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "avcore.h"
-
-/**
- * @file
- * various utility functions
- */
-
-unsigned avcore_version(void)
-{
- return LIBAVCORE_VERSION_INT;
-}
-
-#if 0
-const char *avcore_configuration(void)
-{
- return FFMPEG_CONFIGURATION;
-}
-
-const char *avcore_license(void)
-{
-#define LICENSE_PREFIX "libavcore license: "
- return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1;
-}
-#endif
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include "avcore.h"
+
+/**
+ * @file
+ * various utility functions
+ */
+
+unsigned avcore_version(void)
+{
+ return LIBAVCORE_VERSION_INT;
+}
+
+#if 0
+const char *avcore_configuration(void)
+{
+ return FFMPEG_CONFIGURATION;
+}
+
+const char *avcore_license(void)
+{
+#define LICENSE_PREFIX "libavcore license: "
+ return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1;
+}
+#endif
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcore/imgutils.c b/src/filters/transform/MPCVideoDec/ffmpeg/libavcore/imgutils.c
index f3d75eecb..84db01ae7 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcore/imgutils.c
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcore/imgutils.c
@@ -24,6 +24,30 @@
#include "imgutils.h"
#include "libavutil/pixdesc.h"
+int av_get_image_linesize(enum PixelFormat pix_fmt, int width, int plane)
+{
+ const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];
+ int max_step [4]; /* max pixel step for each plane */
+ int max_step_comp[4]; /* the component for each plane which has the max pixel step */
+ int s, i;
+
+ if (desc->flags & PIX_FMT_BITSTREAM)
+ return (width * (desc->comp[0].step_minus1+1) + 7) >> 3;
+
+ memset(max_step , 0, sizeof(max_step ));
+ memset(max_step_comp, 0, sizeof(max_step_comp));
+ for (i = 0; i < 4; i++) {
+ const AVComponentDescriptor *comp = &(desc->comp[i]);
+ if ((comp->step_minus1+1) > max_step[comp->plane]) {
+ max_step [comp->plane] = comp->step_minus1+1;
+ max_step_comp[comp->plane] = i;
+ }
+ }
+
+ s = (max_step_comp[plane] == 1 || max_step_comp[plane] == 2) ? desc->log2_chroma_w : 0;
+ return max_step[plane] * (((width + (1 << s) - 1)) >> s);
+}
+
int av_fill_image_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int width)
{
int i;
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcore/imgutils.h b/src/filters/transform/MPCVideoDec/ffmpeg/libavcore/imgutils.h
index be6886c38..c2cf6eb53 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcore/imgutils.h
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcore/imgutils.h
@@ -28,6 +28,14 @@
#include "avcore.h"
/**
+ * Compute the size of an image line with format pix_fmt and width
+ * width for the plane plane.
+ *
+ * @return the computed size in bytes
+ */
+int av_get_image_linesize(enum PixelFormat pix_fmt, int width, int plane);
+
+/**
* Fill plane linesizes for an image with pixel format pix_fmt and
* width width.
*