summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2006-04-28 17:29:07 +0000
committerMichael Niedermayer <michaelni@gmx.at>2006-04-28 17:29:07 +0000
commit7f12a9780e2129b788a42574f8e71dc8c22e86d1 (patch)
treec529fc79648bbf805d0228cc0523993a6fc0aa70 /libavcodec
parente27b6e62f7711fae834ee2daee9b252a4fc9f6c0 (diff)
use previous qscale for intra_dc_threshold check
Originally committed as revision 5329 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/h263.c9
-rw-r--r--libavcodec/mpegvideo.h1
2 files changed, 8 insertions, 2 deletions
diff --git a/libavcodec/h263.c b/libavcodec/h263.c
index df05cbac45..29df3b9398 100644
--- a/libavcodec/h263.c
+++ b/libavcodec/h263.c
@@ -3748,6 +3748,8 @@ static int mpeg4_decode_partitioned_mb(MpegEncContext *s, DCTELEM 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;
+
if(s->current_picture.qscale_table[xy] != s->qscale){
ff_set_qscale(s, s->current_picture.qscale_table[xy] );
}
@@ -4484,6 +4486,9 @@ intra:
return -1;
}
cbp = (cbpc & 3) | (cbpy << 2);
+
+ s->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)]);
}
@@ -4779,7 +4784,7 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
//Note intra & rvlc should be optimized away if this is inlined
if(intra) {
- if(s->qscale < s->intra_dc_threshold){
+ if(s->use_intra_dc_vlc){
/* DC coef */
if(s->partitioned_frame){
level = s->dc_val[0][ s->block_index[n] ];
@@ -5003,7 +5008,7 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
}
not_coded:
if (intra) {
- if(s->qscale >= s->intra_dc_threshold){
+ if(!s->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;
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index c08ccec668..d2584e91db 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -602,6 +602,7 @@ 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;