aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2010-01-07 03:58:12 +0000
committerMichael Niedermayer <michaelni@gmx.at>2010-01-07 03:58:12 +0000
commitf016159416c0a5d480c7f9edf57fdb1d3c0effe6 (patch)
treeeec204a740f0f9290f6d83910ac63b15967b8882
parent214cb565c053b9c20fb92d859b9a42121ebe5b83 (diff)
downloadffmpeg-f016159416c0a5d480c7f9edf57fdb1d3c0effe6.tar.gz
Cleanup aspect_to_info().
Originally committed as revision 21048 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/h263.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/libavcodec/h263.c b/libavcodec/h263.c
index 44fa2f90ca..6ff0e90d04 100644
--- a/libavcodec/h263.c
+++ b/libavcodec/h263.c
@@ -151,19 +151,18 @@ static void show_pict_info(MpegEncContext *s){
#if CONFIG_ENCODERS
-static void aspect_to_info(MpegEncContext * s, AVRational aspect){
+static av_const int aspect_to_info(AVRational aspect){
int i;
if(aspect.num==0) aspect= (AVRational){1,1};
for(i=1; i<6; i++){
if(av_cmp_q(pixel_aspect[i], aspect) == 0){
- s->aspect_ratio_info=i;
- return;
+ return i;
}
}
- s->aspect_ratio_info= FF_ASPECT_EXTENDED;
+ return FF_ASPECT_EXTENDED;
}
void ff_flv_encode_picture_header(MpegEncContext * s, int picture_number)
@@ -304,7 +303,7 @@ void h263_encode_picture_header(MpegEncContext * s, int picture_number)
if (format == 7) {
/* Custom Picture Format (CPFMT) */
- aspect_to_info(s, s->avctx->sample_aspect_ratio);
+ s->aspect_ratio_info= aspect_to_info(s->avctx->sample_aspect_ratio);
put_bits(&s->pb,4,s->aspect_ratio_info);
put_bits(&s->pb,9,(s->width >> 2) - 1);
@@ -2308,7 +2307,7 @@ static void mpeg4_encode_vol_header(MpegEncContext * s, int vo_number, int vol_n
put_bits(&s->pb, 3, 1); /* is obj layer priority */
}
- aspect_to_info(s, s->avctx->sample_aspect_ratio);
+ s->aspect_ratio_info= aspect_to_info(s->avctx->sample_aspect_ratio);
put_bits(&s->pb, 4, s->aspect_ratio_info);/* aspect ratio info */
if (s->aspect_ratio_info == FF_ASPECT_EXTENDED){