Commit Graph

32 Commits

Author SHA1 Message Date
Alexander Strasser
ecd71916d1 lavc/aac_ac3_parser: fix potential overflow when averaging bitrate
The new code is analog to how it's done in our mpegaudio parser.

Acked-by: Jun Zhao <barryjzhao@tencent.com>
Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
2020-08-12 17:35:38 +02:00
Jun Zhao
60d79b1df9 lavc/aac_ac3_parser: improve the raw AAC file bit rate calculation
Now we just use one ADTS raw frame to calculate the bit rate, it's
lead to a larger error when get the duration from bit rate, the
improvement cumulate Nth ADTS frames to get the average bit rate.

e,g used the command get the duration like:
ffprobe -show_entries format=duration -i fate-suite/aac/foo.aac

before this improvement dump the duration=2.173935
after this improvement  dump the duration=1.979267

in fact, the real duration can be get by command like:
ffmpeg -i fate-suite/aac/foo.aac -f null /dev/null with time=00:00:01.97

Also update the fate-adtstoasc_ticket3715.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2020-06-26 09:53:36 +08:00
Michael Niedermayer
f0ee0341b0 Merge commit '6258d362b82934a2c27557e0984aed372d98091a'
* commit '6258d362b82934a2c27557e0984aed372d98091a':
  ac3: Do not clash with normal AVERROR

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-28 12:09:41 +02:00
Luca Barbato
6258d362b8 ac3: Do not clash with normal AVERROR
The parsing function return AVERROR and AAC_AC3_PARSE_ERROR values,
make sure they are not misunderstood.
2013-08-27 16:19:12 +02:00
Michael Niedermayer
7a72695c05 Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85'
* commit '36ef5369ee9b336febc2c270f8718cec4476cb85':
  Replace all CODEC_ID_* with AV_CODEC_ID_*
  lavc: add AV prefix to codec ids.

Conflicts:
	doc/APIchanges
	doc/examples/decoding_encoding.c
	doc/examples/muxing.c
	ffmpeg.c
	ffprobe.c
	ffserver.c
	libavcodec/8svx.c
	libavcodec/avcodec.h
	libavcodec/dnxhd_parser.c
	libavcodec/dvdsubdec.c
	libavcodec/error_resilience.c
	libavcodec/h263dec.c
	libavcodec/libvorbisenc.c
	libavcodec/mjpeg_parser.c
	libavcodec/mjpegenc.c
	libavcodec/mpeg12.c
	libavcodec/mpeg4videodec.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_enc.c
	libavcodec/pcm.c
	libavcodec/r210dec.c
	libavcodec/utils.c
	libavcodec/v210dec.c
	libavcodec/version.h
	libavdevice/alsa-audio-dec.c
	libavdevice/bktr.c
	libavdevice/v4l2.c
	libavformat/asfdec.c
	libavformat/asfenc.c
	libavformat/avformat.h
	libavformat/avidec.c
	libavformat/caf.c
	libavformat/electronicarts.c
	libavformat/flacdec.c
	libavformat/flvdec.c
	libavformat/flvenc.c
	libavformat/framecrcenc.c
	libavformat/img2.c
	libavformat/img2dec.c
	libavformat/img2enc.c
	libavformat/ipmovie.c
	libavformat/isom.c
	libavformat/matroska.c
	libavformat/matroskadec.c
	libavformat/matroskaenc.c
	libavformat/mov.c
	libavformat/movenc.c
	libavformat/mp3dec.c
	libavformat/mpeg.c
	libavformat/mpegts.c
	libavformat/mxf.c
	libavformat/mxfdec.c
	libavformat/mxfenc.c
	libavformat/nsvdec.c
	libavformat/nut.c
	libavformat/oggenc.c
	libavformat/pmpdec.c
	libavformat/rawdec.c
	libavformat/rawenc.c
	libavformat/riff.c
	libavformat/sdp.c
	libavformat/utils.c
	libavformat/vocenc.c
	libavformat/wtv.c
	libavformat/xmv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-07 22:45:46 +02:00
Anton Khirnov
36ef5369ee Replace all CODEC_ID_* with AV_CODEC_ID_* 2012-08-07 16:00:24 +02:00
Michael Niedermayer
022f8d27dd Merge remote-tracking branch 'qatar/master'
* qatar/master:
  swscale: Readd #define _SVID_SOURCE
  Fix av_get_channel_layout_string() for positions >31
  configure: Store vda lib flags in extralibs instead of ldflags
  Make channel layout masks unsigned
  dca: ARMv6 optimised decode_blockcode()
  nullenc: drop AVFMT_RAWPICTURE from the flags
  frame-mt: return consumed packet size in ff_thread_decode_frame
  aacdec: add more fate tests covering SBR and PS
  MK(BE)TAG: avoid undefined shifts

Conflicts:
	configure
	libavcodec/arm/dca.h
	libavcodec/dca.c
	libavcodec/mlp_parser.c
	libavcodec/version.h
	libavfilter/asrc_anullsrc.c
	libavfilter/avfilter.c
	libavfilter/avfilter.h
	libavfilter/defaults.c
	libavutil/audioconvert.c
	libavutil/avutil.h
	libswscale/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-26 01:12:08 +01:00
Mans Rullgard
cc276c85d1 Make channel layout masks unsigned
It makes more sense for a bit mask to use an unsigned type.
The change should be source and binary compatible on all
supported systems, hence micro version bump.

Fixes a few invalid shifts.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-11-25 13:19:54 +00:00
Michael Niedermayer
27ef7b1bcd Merge remote-tracking branch 'newdev/master'
* newdev/master:
  mov: set audio service type for AC-3 from bitstream mode in the 'dac3' atom.
  Get audio_service_type for AC-3 based on bitstream mode in the AC-3 parser and decoder, and vice-versa for the AC-3 encoder.
  Use audio_service_type to set stream disposition.
  Add APIchanges entry for audio_service_type.
  Add audio_service_type field to AVCodecContext for encoding and reporting of the service type in the audio bitstream.
  configure: in check_ld, place new -l flags before existing ones
  support @heading, @subheading, @subsubheading, and @subsubsection in texi2pod.pl
  doc: update build system documentation
  aacenc: indentation
  aacenc: fix the side calculation in search_for_ms
  vp8.c: rename EDGE_* to VP8_EDGE_*.

Conflicts:
	doc/APIchanges
	libavcodec/avcodec.h
	libavcodec/version.h
	libavcodec/vp8.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-03-26 03:06:30 +01:00
Justin Ruggles
be18738801 Get audio_service_type for AC-3 based on bitstream mode in the AC-3 parser
and decoder, and vice-versa for the AC-3 encoder.
2011-03-25 16:59:00 -04:00
Mans Rullgard
2912e87a6c Replace FFmpeg with Libav in licence headers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-19 13:33:20 +00:00
Justin Ruggles
bfeca7beb6 Add channel layout support to the AC-3 decoder and AC-3 parser.
Originally committed as revision 18622 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-04-19 15:05:32 +00:00
Joakim Plate
4cff8dc88f Allow AC-3 parser to modify codec_id.
Patch by Joakim Plate (elupus A ecce D se).

Originally committed as revision 17447 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-02-19 00:28:19 +00:00
Diego Biurrun
406792e7b0 cosmetics: Remove pointless period after copyright statement non-sentences.
Originally committed as revision 16684 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-01-19 15:46:40 +00:00
Alex Converse
11d6f38cc9 Factorise enum of AC3 error types to be usable by AAC in the ADTS patch that
will follow

Patch by Alex Converse ( alex converse gmail com )

Originally committed as revision 16479 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-01-07 18:10:10 +00:00
Stefano Sabatini
987903826b Globally rename the header inclusion guard names.
Consistently apply this rule: the guard name is obtained from the
filename by stripping the leading "lib", converting '/' and '.'  to
'_' and uppercasing the resulting name. Guard names in the root
directory have to be prefixed by "FFMPEG_".

Originally committed as revision 15120 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-08-31 07:39:47 +00:00
Justin Ruggles
14b7062829 cosmetics: make all references to AC-3 capitalized and hyphenated
Originally committed as revision 14523 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-08-03 16:42:32 +00:00
David Liu
7694a7d93f Close parse context.
Patch by David LIU david liu st com

Originally committed as revision 13962 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-06-25 12:30:35 +00:00
Måns Rullgård
7c43009358 add necessary #includes in headers
Originally committed as revision 13043 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-05-03 13:29:39 +00:00
Michael Niedermayer
133ac890fb Add new_frame_start and need_next_header.
based on a patch by Bartlomiej

Originally committed as revision 12895 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-04-19 01:59:55 +00:00
Michael Niedermayer
454064ad1e Change aac and ac3 parsers to use ff_combine_frame().
Originally committed as revision 12894 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-04-19 01:50:40 +00:00
Michael Niedermayer
8c731c9743 remove AACAC3FrameFlag
Originally committed as revision 12888 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-04-18 03:09:01 +00:00
Bartlomiej Wolowiec
469d8816d6 undo changes in aac_ac3_parser
Originally committed as revision 12778 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-04-09 22:11:21 +00:00
Bartlomiej Wolowiec
c09ed33e18 Corrections of errors in aac_ac3_parser
Originally committed as revision 12759 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-04-07 20:54:08 +00:00
Bartlomiej Wolowiec
0a5754c3b7 change of aac_ac3_parser, so it is able to send complete portion of data to decoder
Originally committed as revision 12758 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-04-05 20:09:36 +00:00
Bartlomiej Wolowiec
be1e2a2bfa removal of stream_type in AACAC3ParseContext and adding AACAC3FrameFlag
Originally committed as revision 12622 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-03-28 19:59:58 +00:00
Bartlomiej Wolowiec
4e6eeaf019 using stream type in eac3 parser
Originally committed as revision 12570 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-03-24 21:25:49 +00:00
Justin Ruggles
c599e297e7 Pass AACAC3ParseContext to sync() instead of individual arguments. Patch by
Bartlomiej Wolowiec (bartek wolowiec gmail com)

Originally committed as revision 12564 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-03-23 15:43:29 +00:00
Diego Biurrun
5b21bdabe4 Add FFMPEG_ prefix to all multiple inclusion guards.
Originally committed as revision 10765 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-10-17 09:37:46 +00:00
Måns Rullgård
99545457bf include all prerequisites in header files
Originally committed as revision 9344 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-06-16 22:59:13 +00:00
Aurelien Jacobs
679c2294cb cosmetics: rename for consistency after previous aac and ac3 parsers move
Originally committed as revision 8942 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-05-08 23:29:07 +00:00
Aurelien Jacobs
99ff31dc75 move aac and ac3 parsers in their own files
Originally committed as revision 8941 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-05-08 23:25:31 +00:00