[FFmpeg-soc] [soc]: r5614 - in amr: amrnbdata.h amrnbdec.c

vitor subversion at mplayerhq.hu
Sat Jan 30 05:22:15 CET 2010


Author: vitor
Date: Sat Jan 30 05:22:15 2010
New Revision: 5614

Log:
Store frame size in bytes instead of bits. Should allows for sharing the table
with the amr demuxer.

Modified:
   amr/amrnbdata.h
   amr/amrnbdec.c

Modified: amr/amrnbdata.h
==============================================================================
--- amr/amrnbdata.h	Sat Jan 30 05:16:55 2010	(r5613)
+++ amr/amrnbdata.h	Sat Jan 30 05:22:15 2010	(r5614)
@@ -365,9 +365,9 @@ static const uint8_t * const amr_unpacki
     order_MODE_DTX,
 };
 
-/** number of bits for each mode */
-static const uint8_t mode_bits[N_MODES] = {
-    95, 103, 118, 134, 148, 159, 204, 244, 35
+/** number of bytes for each mode */
+static const uint8_t frame_sizes_nb[N_MODES] = {
+    12, 13, 15, 17, 19, 20, 26, 31, 5
 };
 
 /**

Modified: amr/amrnbdec.c
==============================================================================
--- amr/amrnbdec.c	Sat Jan 30 05:16:55 2010	(r5613)
+++ amr/amrnbdec.c	Sat Jan 30 05:22:15 2010	(r5614)
@@ -1069,7 +1069,7 @@ static int amrnb_decode_frame(AVCodecCon
     *data_size = AMR_BLOCK_SIZE * sizeof(float);
 
     /* return the amount of bytes consumed if everything was OK */
-    return (mode_bits[p->cur_frame_mode] + 15) >> 3; // +7 for rounding and +8 for TOC
+    return frame_sizes_nb[p->cur_frame_mode] + 1; // +7 for rounding and +8 for TOC
 }
 
 


More information about the FFmpeg-soc mailing list