]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mpegaudioenc.c
RV3/4: calculate B-frame motion weights once per frame
[ffmpeg] / libavcodec / mpegaudioenc.c
index 50876ec2a41bfb1c6f59a6b20b6c0b4de4b88ce9..96c0fec445763adba998cfe468a46c9ab4efb533 100644 (file)
@@ -315,8 +315,6 @@ static void filter(MpegAudioContext *s, int ch, const short *samples, int incr)
     int tmp1[32];
     int *out;
 
-    //    print_pow1(samples, 1152);
-
     offset = s->samples_offset[ch];
     out = &s->sb_samples[ch][0][0][0];
     for(j=0;j<36;j++) {
@@ -360,8 +358,6 @@ static void filter(MpegAudioContext *s, int ch, const short *samples, int incr)
         }
     }
     s->samples_offset[ch] = offset;
-
-    //    print_pow(s->sb_samples, 1152);
 }
 
 static void compute_scale_factors(unsigned char scale_code[SBLIMIT],
@@ -544,11 +540,11 @@ static void compute_bit_allocation(MpegAudioContext *s,
                 }
             }
         }
-        av_dlog(NULL, "current=%d max=%d max_sb=%d alloc=%d\n",
-                current_frame_size, max_frame_size, max_sb,
-                bit_alloc[max_sb]);
         if (max_sb < 0)
             break;
+        av_dlog(NULL, "current=%d max=%d max_sb=%d max_ch=%d alloc=%d\n",
+                current_frame_size, max_frame_size, max_sb, max_ch,
+                bit_alloc[max_ch][max_sb]);
 
         /* find alloc table entry (XXX: not optimal, should use
            pointer table) */
@@ -764,14 +760,13 @@ static av_cold int MPA_encode_close(AVCodecContext *avctx)
 }
 
 AVCodec ff_mp2_encoder = {
-    "mp2",
-    AVMEDIA_TYPE_AUDIO,
-    CODEC_ID_MP2,
-    sizeof(MpegAudioContext),
-    MPA_encode_init,
-    MPA_encode_frame,
-    MPA_encode_close,
-    NULL,
+    .name           = "mp2",
+    .type           = AVMEDIA_TYPE_AUDIO,
+    .id             = CODEC_ID_MP2,
+    .priv_data_size = sizeof(MpegAudioContext),
+    .init           = MPA_encode_init,
+    .encode         = MPA_encode_frame,
+    .close          = MPA_encode_close,
     .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
     .supported_samplerates= (const int[]){44100, 48000,  32000, 22050, 24000, 16000, 0},
     .long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),