[FFmpeg-cvslog] r24611 - trunk/libavcodec/flacenc.c

jbr subversion
Fri Jul 30 23:32:19 CEST 2010


Author: jbr
Date: Fri Jul 30 23:32:19 2010
New Revision: 24611

Log:
Combine output_subframe() and output_subframes().

Modified:
   trunk/libavcodec/flacenc.c

Modified: trunk/libavcodec/flacenc.c
==============================================================================
--- trunk/libavcodec/flacenc.c	Fri Jul 30 23:27:00 2010	(r24610)
+++ trunk/libavcodec/flacenc.c	Fri Jul 30 23:32:19 2010	(r24611)
@@ -1101,13 +1101,23 @@ static void output_frame_header(FlacEnco
 }
 
 
-static void output_subframe(FlacEncodeContext *s, FlacSubframe *sub)
+static void output_subframes(FlacEncodeContext *s)
 {
+    int ch;
+
+    for (ch = 0; ch < s->channels; ch++) {
+        FlacSubframe *sub = &s->frame.subframes[ch];
     int i, p, porder, psize;
     int32_t *part_end;
     int32_t *res       =  sub->residual;
     int32_t *frame_end = &sub->residual[s->frame.blocksize];
 
+        /* subframe header */
+        put_bits(&s->pb, 1, 0);
+        put_bits(&s->pb, 6, sub->type_code);
+        put_bits(&s->pb, 1, 0); /* no wasted bits */
+
+        /* subframe */
     if (sub->type == FLAC_SUBFRAME_CONSTANT) {
         put_sbits(&s->pb, sub->obits, res[0]);
     } else if (sub->type == FLAC_SUBFRAME_VERBATIM) {
@@ -1145,24 +1155,6 @@ static void output_subframe(FlacEncodeCo
             part_end = FFMIN(frame_end, part_end + psize);
         }
     }
-}
-
-
-static void output_subframes(FlacEncodeContext *s)
-{
-    FlacSubframe *sub;
-    int ch;
-
-    for (ch = 0; ch < s->channels; ch++) {
-        sub = &s->frame.subframes[ch];
-
-        /* subframe header */
-        put_bits(&s->pb, 1, 0);
-        put_bits(&s->pb, 6, sub->type_code);
-        put_bits(&s->pb, 1, 0); /* no wasted bits */
-
-        /* subframe */
-        output_subframe(s, sub);
     }
 }
 



More information about the ffmpeg-cvslog mailing list