aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-12-06 01:14:46 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-12-06 01:14:46 +0100
commit92e10e34b1422423715bbfadfcd19b045f63dbcc (patch)
tree397c5fe54835f043d6bc40bce7fb1e02b13c034e /libavcodec
parent56572787ae2d7e113e36d5347b3d7263b35bdf98 (diff)
parente41ff4210ac1192c62de3052b33a38c7bcf772f2 (diff)
downloadffmpeg-92e10e34b1422423715bbfadfcd19b045f63dbcc.tar.gz
Merge commit 'e41ff4210ac1192c62de3052b33a38c7bcf772f2'
* commit 'e41ff4210ac1192c62de3052b33a38c7bcf772f2': mpeg4videodec: move use_intra_dc_vlc from MpegEncContext to Mpeg4DecContext Conflicts: libavcodec/mpeg4videodec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mpeg4video.h1
-rw-r--r--libavcodec/mpeg4videodec.c17
-rw-r--r--libavcodec/mpegvideo.h1
3 files changed, 10 insertions, 9 deletions
diff --git a/libavcodec/mpeg4video.h b/libavcodec/mpeg4video.h
index b6b0e5479f..dbad7f681a 100644
--- a/libavcodec/mpeg4video.h
+++ b/libavcodec/mpeg4video.h
@@ -83,6 +83,7 @@ typedef struct Mpeg4DecContext {
int new_pred;
int enhancement_type;
int scalability;
+ int use_intra_dc_vlc;
/* bug workarounds */
int divx_version;
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index a9243fc29a..80d08e601d 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -933,9 +933,10 @@ int ff_mpeg4_decode_partitions(Mpeg4DecContext *ctx)
* Decode a block.
* @return <0 if an error occurred
*/
-static inline int mpeg4_decode_block(MpegEncContext *s, int16_t *block,
+static inline int mpeg4_decode_block(Mpeg4DecContext *ctx, int16_t *block,
int n, int coded, int intra, int rvlc)
{
+ MpegEncContext *s = &ctx->m;
int level, i, last, run, qmul, qadd;
int av_uninit(dc_pred_dir);
RLTable *rl;
@@ -945,7 +946,7 @@ static inline int mpeg4_decode_block(MpegEncContext *s, int16_t *block,
// Note intra & rvlc should be optimized away if this is inlined
if (intra) {
- if (s->use_intra_dc_vlc) {
+ if (ctx->use_intra_dc_vlc) {
/* DC coef */
if (s->partitioned_frame) {
level = s->dc_val[0][s->block_index[n]];
@@ -1182,7 +1183,7 @@ static inline int mpeg4_decode_block(MpegEncContext *s, int16_t *block,
not_coded:
if (intra) {
- if (!s->use_intra_dc_vlc) {
+ if (!ctx->use_intra_dc_vlc) {
block[0] = ff_mpeg4_pred_dc(s, n, block[0], &dc_pred_dir, 0);
i -= i >> 31; // if (i == -1) i = 0;
@@ -1209,7 +1210,7 @@ static int mpeg4_decode_partitioned_mb(MpegEncContext *s, int16_t block[6][64])
mb_type = s->current_picture.mb_type[xy];
cbp = s->cbp_table[xy];
- s->use_intra_dc_vlc = s->qscale < s->intra_dc_threshold;
+ ctx->use_intra_dc_vlc = s->qscale < s->intra_dc_threshold;
if (s->current_picture.qscale_table[xy] != s->qscale)
ff_set_qscale(s, s->current_picture.qscale_table[xy]);
@@ -1259,7 +1260,7 @@ static int mpeg4_decode_partitioned_mb(MpegEncContext *s, int16_t block[6][64])
s->dsp.clear_blocks(s->block[0]);
/* decode each block */
for (i = 0; i < 6; i++) {
- if (mpeg4_decode_block(s, block[i], i, cbp & 32, s->mb_intra, ctx->rvlc) < 0) {
+ if (mpeg4_decode_block(ctx, block[i], i, cbp & 32, s->mb_intra, ctx->rvlc) < 0) {
av_log(s->avctx, AV_LOG_ERROR,
"texture corrupted at %d %d %d\n",
s->mb_x, s->mb_y, s->mb_intra);
@@ -1607,7 +1608,7 @@ intra:
}
cbp = (cbpc & 3) | (cbpy << 2);
- s->use_intra_dc_vlc = s->qscale < s->intra_dc_threshold;
+ ctx->use_intra_dc_vlc = s->qscale < s->intra_dc_threshold;
if (dquant)
ff_set_qscale(s, s->qscale + quant_tab[get_bits(&s->gb, 2)]);
@@ -1618,7 +1619,7 @@ intra:
s->dsp.clear_blocks(s->block[0]);
/* decode each block */
for (i = 0; i < 6; i++) {
- if (mpeg4_decode_block(s, block[i], i, cbp & 32, 1, 0) < 0)
+ if (mpeg4_decode_block(ctx, block[i], i, cbp & 32, 1, 0) < 0)
return -1;
cbp += cbp;
}
@@ -1627,7 +1628,7 @@ intra:
/* decode each block */
for (i = 0; i < 6; i++) {
- if (mpeg4_decode_block(s, block[i], i, cbp & 32, 0, 0) < 0)
+ if (mpeg4_decode_block(ctx, block[i], i, cbp & 32, 0, 0) < 0)
return -1;
cbp += cbp;
}
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index 1cd56ea42b..614a45bb5b 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -609,7 +609,6 @@ typedef struct MpegEncContext {
int vo_type;
int vol_control_parameters; ///< does the stream contain the low_delay flag, used to workaround buggy encoders
int intra_dc_threshold; ///< QP above whch the ac VLC should be used for intra dc
- int use_intra_dc_vlc;
PutBitContext tex_pb; ///< used for data partitioned VOPs
PutBitContext pb2; ///< used for data partitioned VOPs
int mpeg_quant;