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

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-24 18:07:51 +0300
committerMichael Niedermayer <michaelni@gmx.at>2015-05-24 18:27:47 +0300
commitdb5ea69d80d9461ab3f3748b5942cc14d13b523b (patch)
treee78f4200232a6bdace5a27fc1a085dab498d644e /libavcodec/ituh263enc.c
parent404fe63e23433aa559cee5366cb26f78b425e7e5 (diff)
avcodec/ituh263enc: Pass PutBitContext into h263p_encode_umotion() instead of MpegEncContext
This avoids the need to dereference MpegEncContext->pb if it is already available outside h263p_encode_umotion() Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ituh263enc.c')
-rw-r--r--libavcodec/ituh263enc.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libavcodec/ituh263enc.c b/libavcodec/ituh263enc.c
index cbe8acb7b0..15b2ef183d 100644
--- a/libavcodec/ituh263enc.c
+++ b/libavcodec/ituh263enc.c
@@ -406,7 +406,7 @@ static void h263_encode_block(MpegEncContext * s, int16_t * block, int n)
}
/* Encode MV differences on H.263+ with Unrestricted MV mode */
-static void h263p_encode_umotion(MpegEncContext * s, int val)
+static void h263p_encode_umotion(PutBitContext *pb, int val)
{
short sval = 0;
short i = 0;
@@ -416,11 +416,11 @@ static void h263p_encode_umotion(MpegEncContext * s, int val)
int tcode;
if ( val == 0)
- put_bits(&s->pb, 1, 1);
+ put_bits(pb, 1, 1);
else if (val == 1)
- put_bits(&s->pb, 3, 0);
+ put_bits(pb, 3, 0);
else if (val == -1)
- put_bits(&s->pb, 3, 2);
+ put_bits(pb, 3, 2);
else {
sval = ((val < 0) ? (short)(-val):(short)val);
@@ -439,7 +439,7 @@ static void h263p_encode_umotion(MpegEncContext * s, int val)
i--;
}
code = ((code << 1) | (val < 0)) << 1;
- put_bits(&s->pb, (2*n_bits)+1, code);
+ put_bits(pb, (2*n_bits)+1, code);
}
}
@@ -496,8 +496,8 @@ void ff_h263_encode_mb(MpegEncContext * s,
motion_y - pred_y, 1);
}
else {
- h263p_encode_umotion(s, motion_x - pred_x);
- h263p_encode_umotion(s, motion_y - pred_y);
+ h263p_encode_umotion(&s->pb, motion_x - pred_x);
+ h263p_encode_umotion(&s->pb, motion_y - pred_y);
if (((motion_x - pred_x) == 1) && ((motion_y - pred_y) == 1))
/* To prevent Start Code emulation */
put_bits(&s->pb,1,1);
@@ -525,8 +525,8 @@ void ff_h263_encode_mb(MpegEncContext * s,
motion_y - pred_y, 1);
}
else {
- h263p_encode_umotion(s, motion_x - pred_x);
- h263p_encode_umotion(s, motion_y - pred_y);
+ h263p_encode_umotion(&s->pb, motion_x - pred_x);
+ h263p_encode_umotion(&s->pb, motion_y - pred_y);
if (((motion_x - pred_x) == 1) && ((motion_y - pred_y) == 1))
/* To prevent Start Code emulation */
put_bits(&s->pb,1,1);