aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h261enc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-01-31 04:57:50 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-01-31 04:57:50 +0100
commit9f73b88c624a0b70a3d1169b9f6fa49002dfb94a (patch)
tree4b64cc93e2c7653851d8dc3508947ec70de5d179 /libavcodec/h261enc.c
parentf5722ba276e524a48973d9db63b80a3dcc206ce4 (diff)
downloadffmpeg-9f73b88c624a0b70a3d1169b9f6fa49002dfb94a.tar.gz
avcodec/h261enc: fix dquant encoding
Fixes Ticket4111 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h261enc.c')
-rw-r--r--libavcodec/h261enc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/h261enc.c b/libavcodec/h261enc.c
index 75211a0712..d7b56a8e43 100644
--- a/libavcodec/h261enc.c
+++ b/libavcodec/h261enc.c
@@ -250,12 +250,13 @@ void ff_h261_encode_mb(MpegEncContext *s, int16_t block[6][64],
/* mvd indicates if this block is motion compensated */
mvd = motion_x | motion_y;
- if ((cbp | mvd | s->dquant) == 0) {
+ if ((cbp | mvd) == 0) {
/* skip macroblock */
s->skip_count++;
s->mb_skip_run++;
s->last_mv[0][0][0] = 0;
s->last_mv[0][0][1] = 0;
+ s->qscale -= s->dquant;
return;
}
}
@@ -274,13 +275,15 @@ void ff_h261_encode_mb(MpegEncContext *s, int16_t block[6][64],
h->mtype += 3;
if (s->loop_filter)
h->mtype += 3;
- if (cbp || s->dquant)
+ if (cbp)
h->mtype++;
av_assert1(h->mtype > 1);
}
- if (s->dquant)
+ if (s->dquant && cbp) {
h->mtype++;
+ } else
+ s->qscale -= s->dquant;
put_bits(&s->pb,
ff_h261_mtype_bits[h->mtype],