summaryrefslogtreecommitdiff
path: root/libavcodec/h261enc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-01-28 19:27:14 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-02-13 15:25:13 +0100
commite911f5546f6d490a8c81841611835d9006d239e5 (patch)
tree456c26a2e096a725ed16ffc79758d5046f97f3c8 /libavcodec/h261enc.c
parent8401b9460279df657dead86e1fecd71eb4efd7fc (diff)
avcodec/h261enc: Pass PutBitContext directly in h261_encode_motion()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/h261enc.c')
-rw-r--r--libavcodec/h261enc.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/libavcodec/h261enc.c b/libavcodec/h261enc.c
index f1cd51ec2f..66b7cc18fd 100644
--- a/libavcodec/h261enc.c
+++ b/libavcodec/h261enc.c
@@ -141,13 +141,12 @@ void ff_h261_reorder_mb_index(MpegEncContext *s)
}
}
-static void h261_encode_motion(H261EncContext *h, int val)
+static void h261_encode_motion(PutBitContext *pb, int val)
{
- MpegEncContext *const s = &h->s;
int sign, code;
if (val == 0) {
code = 0;
- put_bits(&s->pb, ff_h261_mv_tab[code][1], ff_h261_mv_tab[code][0]);
+ put_bits(pb, ff_h261_mv_tab[code][1], ff_h261_mv_tab[code][0]);
} else {
if (val > 15)
val -= 32;
@@ -155,8 +154,8 @@ static void h261_encode_motion(H261EncContext *h, int val)
val += 32;
sign = val < 0;
code = sign ? -val : val;
- put_bits(&s->pb, ff_h261_mv_tab[code][1], ff_h261_mv_tab[code][0]);
- put_bits(&s->pb, 1, sign);
+ put_bits(pb, ff_h261_mv_tab[code][1], ff_h261_mv_tab[code][0]);
+ put_bits(pb, 1, sign);
}
}
@@ -314,8 +313,8 @@ void ff_h261_encode_mb(MpegEncContext *s, int16_t block[6][64],
mv_diff_y = (motion_y >> 1) - s->last_mv[0][0][1];
s->last_mv[0][0][0] = (motion_x >> 1);
s->last_mv[0][0][1] = (motion_y >> 1);
- h261_encode_motion(h, mv_diff_x);
- h261_encode_motion(h, mv_diff_y);
+ h261_encode_motion(&s->pb, mv_diff_x);
+ h261_encode_motion(&s->pb, mv_diff_y);
}
if (HAS_CBP(com->mtype)) {