[FFmpeg-soc] [soc]: r2233 - in eac3: ac3dec.c ac3dec.h checkout.sh eac3dec.c ffmpeg.patch
jbr
subversion at mplayerhq.hu
Tue May 27 06:56:30 CEST 2008
Author: jbr
Date: Tue May 27 06:56:30 2008
New Revision: 2233
Log:
change name stream_type to frame_type
Modified:
eac3/ac3dec.c
eac3/ac3dec.h
eac3/checkout.sh
eac3/eac3dec.c
eac3/ffmpeg.patch
Modified: eac3/ac3dec.c
==============================================================================
--- eac3/ac3dec.c (original)
+++ eac3/ac3dec.c Tue May 27 06:56:30 2008
@@ -1060,7 +1060,7 @@ static int decode_audio_block(AC3DecodeC
}
/* E-AC3 to AC3 converter SNR offset */
- if (s->eac3 && s->stream_type == EAC3_STREAM_TYPE_INDEPENDENT &&
+ if (s->eac3 && s->frame_type == EAC3_FRAME_TYPE_INDEPENDENT &&
get_bits1(gbc)) {
skip_bits(gbc, 10); // skip converter snr offset
}
Modified: eac3/ac3dec.h
==============================================================================
--- eac3/ac3dec.h (original)
+++ eac3/ac3dec.h Tue May 27 06:56:30 2008
@@ -57,7 +57,7 @@ typedef struct AC3DecodeContext {
///@defgroup bsi Bit Stream Information
///@{
- int stream_type; ///< Stream type (strmtyp)
+ int frame_type; ///< Frame type (strmtyp)
int substreamid; ///< Substream identification
int frame_size; ///< Frame size, in bytes
int bit_rate; ///< Bitrate, in bits-per-second
Modified: eac3/checkout.sh
==============================================================================
--- eac3/checkout.sh (original)
+++ eac3/checkout.sh Tue May 27 06:56:30 2008
@@ -1,7 +1,7 @@
FILES="eac3dec.c ac3dec.c ac3dec.h ac3dec_data.c ac3dec_data.h"
echo "checking out ffmpeg svn"
-for i in $FILES Makefile ac3_parser.c ac3enc.c ac3.c ac3.h; do
+for i in $FILES Makefile aac_ac3_parser.h aac_parser.c ac3_parser.c ac3_parser.h ac3enc.c ac3.c ac3.h; do
rm -f ffmpeg/libavcodec/$i
done
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk/ ffmpeg -r 12599
Modified: eac3/eac3dec.c
==============================================================================
--- eac3/eac3dec.c (original)
+++ eac3/eac3dec.c Tue May 27 06:56:30 2008
@@ -276,12 +276,12 @@ static int parse_bsi(AC3DecodeContext *s
/* an E-AC3 stream can have multiple independent streams which the
application can select from. each independent stream can also contain
dependent streams which are used to add or replace channels. */
- s->stream_type = get_bits(gbc, 2);
- if (s->stream_type == EAC3_STREAM_TYPE_DEPENDENT) {
+ s->frame_type = get_bits(gbc, 2);
+ if (s->frame_type == EAC3_FRAME_TYPE_DEPENDENT) {
ff_eac3_log_missing_feature(s->avctx, "Dependent substream");
return -1;
- } else if (s->stream_type == EAC3_STREAM_TYPE_RESERVED) {
- av_log(s->avctx, AV_LOG_ERROR, "Reserved stream type\n");
+ } else if (s->frame_type == EAC3_FRAME_TYPE_RESERVED) {
+ av_log(s->avctx, AV_LOG_ERROR, "Reserved frame type\n");
return -1;
}
@@ -323,7 +323,7 @@ static int parse_bsi(AC3DecodeContext *s
#if 0
/* dependent stream channel map */
- if (s->stream_type == EAC3_STREAM_TYPE_DEPENDENT) {
+ if (s->frame_type == EAC3_FRAME_TYPE_DEPENDENT) {
if (get_bits1(gbc)) {
s->channel_map = get_bits(gbc, 16); //custom channel map
} else {
@@ -359,7 +359,7 @@ static int parse_bsi(AC3DecodeContext *s
}
/* info for mixing with other streams and substreams */
- if (s->stream_type == EAC3_STREAM_TYPE_INDEPENDENT) {
+ if (s->frame_type == EAC3_FRAME_TYPE_INDEPENDENT) {
for (i = 0; i < (s->channel_mode ? 1 : 2); i++) {
// TODO: apply program scale factor
if (get_bits1(gbc)) {
@@ -430,12 +430,12 @@ static int parse_bsi(AC3DecodeContext *s
if frames are less than six blocks, this bit should be turned on
once every 6 blocks to indicate the start of a frame set.
reference: RFC 4598, Section 2.1.3 Frame Sets */
- if (s->stream_type == EAC3_STREAM_TYPE_INDEPENDENT && s->num_blocks != 6) {
+ if (s->frame_type == EAC3_FRAME_TYPE_INDEPENDENT && s->num_blocks != 6) {
skip_bits1(gbc); //converter synchronization flag
}
/* original frame size code if this stream was converted from AC3 */
- if (s->stream_type == EAC3_STREAM_TYPE_AC3_CONVERT &&
+ if (s->frame_type == EAC3_FRAME_TYPE_AC3_CONVERT &&
(s->num_blocks == 6 || get_bits1(gbc))) {
skip_bits(gbc, 6); // skip Frame size code
}
@@ -540,7 +540,7 @@ static int parse_audfrm(AC3DecodeContext
}
}
/* original exponent strategies if this stream was converted from AC3 */
- if (s->stream_type == EAC3_STREAM_TYPE_INDEPENDENT &&
+ if (s->frame_type == EAC3_FRAME_TYPE_INDEPENDENT &&
(s->num_blocks == 6 || get_bits1(gbc))) {
for (ch = 1; ch <= s->fbw_channels; ch++) {
skip_bits(gbc, 5); //skip Converter channel exponent strategy
@@ -1125,7 +1125,7 @@ int ff_eac3_parse_audio_block(AC3DecodeC
for (ch = !s->cpl_in_use[blk]; ch <= s->channels; ch++)
s->fast_gain[ch] = ff_ac3_fast_gain_tab[4];
}
- if (s->stream_type == EAC3_STREAM_TYPE_INDEPENDENT && get_bits1(gbc)) {
+ if (s->frame_type == EAC3_FRAME_TYPE_INDEPENDENT && get_bits1(gbc)) {
skip_bits(gbc, 10); //Converter SNR offset
}
}
Modified: eac3/ffmpeg.patch
==============================================================================
--- eac3/ffmpeg.patch (original)
+++ eac3/ffmpeg.patch Tue May 27 06:56:30 2008
@@ -1,3 +1,16 @@
+Index: libavcodec/aac_ac3_parser.h
+===================================================================
+--- libavcodec/aac_ac3_parser.h (revision 12599)
++++ libavcodec/aac_ac3_parser.h (working copy)
+@@ -37,7 +37,7 @@
+ int sample_rate;
+ int bit_rate;
+ int samples;
+- uint8_t stream_type;
++ uint8_t frame_type;
+ } AACAC3ParseContext;
+
+ int ff_aac_ac3_parse(AVCodecParserContext *s1,
Index: libavcodec/Makefile
===================================================================
--- libavcodec/Makefile (revision 12599)
@@ -11,6 +24,19 @@ Index: libavcodec/Makefile
OBJS-$(CONFIG_AC3_ENCODER) += ac3enc.o ac3tab.o ac3.o
OBJS-$(CONFIG_ALAC_DECODER) += alac.o
OBJS-$(CONFIG_AMV_DECODER) += sp5xdec.o mjpegdec.o mjpeg.o
+Index: libavcodec/aac_parser.c
+===================================================================
+--- libavcodec/aac_parser.c (revision 12599)
++++ libavcodec/aac_parser.c (working copy)
+@@ -84,7 +84,7 @@
+ static av_cold int aac_parse_init(AVCodecParserContext *s1)
+ {
+ AACAC3ParseContext *s = s1->priv_data;
+- s->stream_type = EAC3_STREAM_TYPE_INDEPENDENT;
++ s->frame_type = EAC3_FRAME_TYPE_INDEPENDENT;
+ s->inbuf_ptr = s->inbuf;
+ s->header_size = AAC_HEADER_SIZE;
+ s->sync = aac_sync;
Index: libavcodec/ac3_parser.c
===================================================================
--- libavcodec/ac3_parser.c (revision 12599)
@@ -23,14 +49,25 @@ Index: libavcodec/ac3_parser.c
memset(hdr, 0, sizeof(*hdr));
-@@ -84,6 +83,7 @@
+@@ -84,13 +83,14 @@
hdr->bit_rate = (ff_ac3_bitrate_tab[frame_size_code>>1] * 1000) >> hdr->sr_shift;
hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on;
hdr->frame_size = ff_ac3_frame_size_tab[frame_size_code][hdr->sr_code] * 2;
+- hdr->stream_type = EAC3_STREAM_TYPE_INDEPENDENT;
+ hdr->num_blocks = 6;
- hdr->stream_type = EAC3_STREAM_TYPE_INDEPENDENT;
++ hdr->frame_type = EAC3_FRAME_TYPE_INDEPENDENT;
} else {
/* Enhanced AC-3 */
+ hdr->crc1 = 0;
+- hdr->stream_type = get_bits(&gbc, 2);
+- if(hdr->stream_type == EAC3_STREAM_TYPE_RESERVED)
+- return AC3_PARSE_ERROR_STREAM_TYPE;
++ hdr->frame_type = get_bits(&gbc, 2);
++ if(hdr->frame_type == EAC3_FRAME_TYPE_RESERVED)
++ return AC3_PARSE_ERROR_FRAME_TYPE;
+
+ skip_bits(&gbc, 3); // skip substream id
+
@@ -105,9 +105,9 @@
return AC3_PARSE_ERROR_SAMPLE_RATE;
hdr->sample_rate = ff_ac3_sample_rate_tab[sr_code2] / 2;
@@ -61,6 +98,19 @@ Index: libavcodec/ac3_parser.c
return hdr.frame_size;
}
+Index: libavcodec/ac3_parser.h
+===================================================================
+--- libavcodec/ac3_parser.h (revision 12599)
++++ libavcodec/ac3_parser.h (working copy)
+@@ -30,7 +30,7 @@
+ AC3_PARSE_ERROR_BSID = -2,
+ AC3_PARSE_ERROR_SAMPLE_RATE = -3,
+ AC3_PARSE_ERROR_FRAME_SIZE = -4,
+- AC3_PARSE_ERROR_STREAM_TYPE = -5,
++ AC3_PARSE_ERROR_FRAME_TYPE = -5,
+ } AC3ParseError;
+
+ /**
Index: libavcodec/ac3.c
===================================================================
--- libavcodec/ac3.c (revision 12599)
@@ -98,7 +148,16 @@ Index: libavcodec/ac3.h
===================================================================
--- libavcodec/ac3.h (revision 12599)
+++ libavcodec/ac3.h (working copy)
-@@ -95,6 +95,7 @@
+@@ -84,7 +84,7 @@
+ uint8_t bitstream_id;
+ uint8_t channel_mode;
+ uint8_t lfe_on;
+- uint8_t stream_type;
++ uint8_t frame_type;
+ /** @} */
+
+ /** @defgroup derived Derived values
+@@ -95,15 +95,16 @@
uint32_t bit_rate;
uint8_t channels;
uint16_t frame_size;
@@ -106,6 +165,20 @@ Index: libavcodec/ac3.h
/** @} */
} AC3HeaderInfo;
+ typedef enum {
+- EAC3_STREAM_TYPE_INDEPENDENT = 0,
+- EAC3_STREAM_TYPE_DEPENDENT,
+- EAC3_STREAM_TYPE_AC3_CONVERT,
+- EAC3_STREAM_TYPE_RESERVED
+-} EAC3StreamType;
++ EAC3_FRAME_TYPE_INDEPENDENT = 0,
++ EAC3_FRAME_TYPE_DEPENDENT,
++ EAC3_FRAME_TYPE_AC3_CONVERT,
++ EAC3_FRAME_TYPE_RESERVED
++} EAC3FrameType;
+
+ void ac3_common_init(void);
+
@@ -163,10 +164,12 @@
* @param[in] end ending bin location
* @param[in] snr_offset SNR adjustment
More information about the FFmpeg-soc
mailing list