changeset 10785:bb3abb64e395 libavcodec

Cleanup aspect_to_info().
author michael
date Thu, 07 Jan 2010 03:58:12 +0000
parents da685f64e8e6
children db269539f68f
files h263.c
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/h263.c	Thu Jan 07 03:54:10 2010 +0000
+++ b/h263.c	Thu Jan 07 03:58:12 2010 +0000
@@ -151,19 +151,18 @@
 
 #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 @@
 
                 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 @@
         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){