Commit Graph

58 Commits

Author SHA1 Message Date
Ganesh Ajjanagadde
7b11eead1b avcodec/ac3: always use hardcoded tables
The table in question is a 253 byte one. In fact, it turns out that
dynamic generation of the table results in an increased binary size.

Code compiled with GCC 5.2.0, x86-64 (size in bytes), before and after
patch:
old: 62321064 libavcodec/libavcodec.so.57
new: 62320536 libavcodec/libavcodec.so.57

Thus, it always make sense to statically allocate this.

Tested with FATE with/without --enable-hardcoded-tables.

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-11-30 18:29:57 -05:00
Andreas Cadhalpun
bc4fee7f2a ac3: validate end in ff_ac3_bit_alloc_calc_mask
This fixes an invalid read if end is 0:
     band_end   = ff_ac3_bin_to_band_tab[end-1] + 1;

Depending on what is before the array, this can cause stack smashing,
when band_end becomes too large.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-16 21:37:16 +02:00
Michael Niedermayer
e3f5b6f16d avcodec/ac3: Fix undefined shift in ff_ac3_bit_alloc_calc_mask()
Found-by: Clang -fsanitize=shift
Reported-by: Thierry Foucu <tfoucu@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-15 11:21:50 +01:00
Michael Niedermayer
c40798441f Merge remote branch 'qatar/master'
* qatar/master:
  ac3dec: fix processing of delta bit allocation information.
  vc1: fix fate-vc1 after previous commit.
  wmv3dec: fix playback of complex WMV3 files using simple_idct.
  make av_dup_packet() more cautious on allocation failures
  make containers pass palette change in AVPacket
  introduce side information for AVPacket

Politic commits that have not been pulled:
  Update regtest checksums after revision 6001dad.
  Replace more FFmpeg references by Libav.
  Replace references to ffmpeg-devel with libav-devel; fix roundup URL.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-17 23:43:54 +02:00
Justin Ruggles
4c64c8e95a ac3dec: fix processing of delta bit allocation information.
The number of dba segments is the coded value + 1.
The coupling dba offset starts at the first coupling band, not at zero.
2011-04-17 12:33:41 -04:00
Michael Niedermayer
445fdc0140 Merge remote-tracking branch 'newdev/master'
* newdev/master:
  ac3enc: move compute_mantissa_size() to ac3dsp
  ac3enc: move mant*_cnt and qmant*_ptr out of AC3EncodeContext
  Remove support for stripping executables
  ac3enc: NEON optimised float_to_fixed24
  ac3: move ff_ac3_bit_alloc_calc_bap to ac3dsp
  dfa: protect pointer range checks against overflows.
Duplicate:  mimic: implement multithreading.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-03-30 03:09:08 +02:00
Mans Rullgard
6d9f52b2cd ac3: move ff_ac3_bit_alloc_calc_bap to ac3dsp
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-29 19:31:45 +01: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
dff80041e3 Add ff_ prefix to ac3_common_init().
Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit 4c57cde942)
2011-01-28 03:15:33 +01:00
Justin Ruggles
e732af87fc ac3: Remove ff_ac3_critical_band_size_tab.
It is only used to generate band_start_tab, which about the same size, at
runtime, so it's simpler just to always hardcode band_start_tab.

Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit 24e3ad3031)
2011-01-28 03:15:32 +01:00
Justin Ruggles
4c57cde942 Add ff_ prefix to ac3_common_init().
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-01-26 15:35:27 +00:00
Justin Ruggles
24e3ad3031 ac3: Remove ff_ac3_critical_band_size_tab.
It is only used to generate band_start_tab, which about the same size, at
runtime, so it's simpler just to always hardcode band_start_tab.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-01-26 15:35:13 +00:00
Diego Elio Pettenò
6b784f1b91 Move ff_ac3_critical_band_size_tab in ac3.c for non-hardcoded tables.
This symbol is only ever used to calculate the non-hardcoded tables, so
only enable it in that case, and static to the source unit that uses it.

Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit 6ed3b504f9)
2011-01-26 03:43:30 +01:00
Diego Elio Pettenò
a172126c38 Remove unused ac3_parametric_bit_allocation function.
Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit 362bfe2997)
2011-01-26 03:43:30 +01:00
Diego Elio Pettenò
6ed3b504f9 Move ff_ac3_critical_band_size_tab in ac3.c for non-hardcoded tables.
This symbol is only ever used to calculate the non-hardcoded tables, so
only enable it in that case, and static to the source unit that uses it.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-01-25 15:10:10 +00:00
Diego Elio Pettenò
362bfe2997 Remove unused ac3_parametric_bit_allocation function.
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-01-25 15:09:46 +00:00
Justin Ruggles
ce571ceb45 Use AC3_MAX_COEFS instead of 256 in a couple places in ac3.c
Originally committed as revision 25968 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-12-14 14:51:43 +00:00
Justin Ruggles
47ae6e795b define AC3_CRITICAL_BANDS and use it in the AC-3 encoder and decoder.
Originally committed as revision 25967 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-12-14 14:51:40 +00:00
Måns Rullgård
49bd8e4b84 Fix grammar errors in documentation
Originally committed as revision 23904 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-06-30 15:38:06 +00:00
Diego Biurrun
ba87f0801d Remove explicit filename from Doxygen @file commands.
Passing an explicit filename to this command is only necessary if the
documentation in the @file block refers to a file different from the
one the block resides in.

Originally committed as revision 22921 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-20 14:45:34 +00:00
Reimar Döffinger
29b75f0b67 Change code so it uses 2 adds instead of one FFABS.
About 1% faster ff_ac3_bit_alloc_calc_psd on Intel Atom, overall speedup
not measurable though.
Should have a bigger effect on systems without cmov or with very slow cmov.

Originally committed as revision 21214 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-01-14 17:50:33 +00:00
Justin Ruggles
31f8c10983 Simplify AC-3 critical band end calculation (correctly this time).
Originally committed as revision 20438 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-11-03 03:26:26 +00:00
Justin Ruggles
94593c9b52 Revert r20050, which caused decoding errors with at least one valid AC-3 file.
Originally committed as revision 20437 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-11-03 02:59:18 +00:00
Justin Ruggles
09e03847b9 Remove unneeded table lookup.
Originally committed as revision 20050 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-09-27 06:16:49 +00:00
Justin Ruggles
444ce49a7a Cosmetics: Rename some variables to be more descriptive of their use.
Originally committed as revision 20049 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-09-27 06:13:01 +00:00
Justin Ruggles
4e745ea83e Move some variable declarations to inside of loops.
Originally committed as revision 20048 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-09-27 06:10:36 +00:00
Justin Ruggles
3538a2e47a Remove unneeded variable.
Originally committed as revision 20047 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-09-27 06:01:32 +00:00
Justin Ruggles
84cb4bc6a2 Cosmetics: Rename some variables to be more descriptive of their use.
Originally committed as revision 20046 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-09-27 05:48:03 +00:00
Justin Ruggles
8a547c25a0 Remove some unneeded variables.
Originally committed as revision 20045 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-09-27 05:39:57 +00:00
Justin Ruggles
403b1543b5 Cosmetics: Rename some variables
Originally committed as revision 20044 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-09-27 05:36:52 +00:00
Justin Ruggles
f805d5fc9d simplify 2 lines into 1 using FFMIN
Originally committed as revision 20043 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-09-27 04:57:36 +00:00
Justin Ruggles
612bdf1808 Cosmetics: Do some basic pretty-printing.
Originally committed as revision 20042 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-09-27 04:55:37 +00:00
Justin Ruggles
bf8643838b Simplify by combining increment with array access.
Originally committed as revision 20041 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-09-27 04:47:38 +00:00
Justin Ruggles
89e6317b5b cosmetics: Rename some variables to be more descriptive of their use. Do some
pretty-printing as well.

Originally committed as revision 20040 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-09-27 04:46:56 +00:00
Justin Ruggles
a7e7417c41 Move 2 variable declarations to inside of loop.
Originally committed as revision 20039 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-09-27 04:41:05 +00:00
Justin Ruggles
20520421a1 simplify by combining increment with array access
Originally committed as revision 20038 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-09-27 04:37:00 +00:00
Justin Ruggles
be5830ea7a Remove unneeded variable
Originally committed as revision 20037 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-09-27 04:32:31 +00:00
Justin Ruggles
b05e4195d4 Hardcode AC-3 critical band tables when CONFIG_HARDCODED_TABLES is set.
Originally committed as revision 20036 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-09-27 04:07:49 +00:00
Stefano Sabatini
9106a698e7 Rename bitstream.h to get_bits.h.
Originally committed as revision 18494 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-04-13 16:20:26 +00:00
Diego Biurrun
bad5537e2c Use full internal pathname in doxygen @file directives.
Otherwise doxygen complains about ambiguous filenames when files exist
under the same name in different subdirectories.

Originally committed as revision 16912 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-02-01 02:00: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
Justin Ruggles
20e047262f cosmetics: alignment after last commit
Originally committed as revision 16035 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-12-08 03:15:10 +00:00
Justin Ruggles
72a6244b5d ac3: detect dba errors and prevent writing past end of array
Originally committed as revision 16034 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-12-08 03:13:20 +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
Justin Ruggles
687671f03b pass bap table to ff_ac3_bit_alloc_calc_bap()
Originally committed as revision 13694 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-06-07 22:29:54 +00:00
Justin Ruggles
31bc6b4549 prevent crash when dba params are invalid
Originally committed as revision 13653 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-06-03 23:34:26 +00:00
Zuxy Meng
98a6fff98c Apply 'cold' attribute to init/uninit functions in libavcodec
Originally committed as revision 12525 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-03-21 03:11:20 +00:00
Justin Ruggles
5ce2134258 cosmetics: rename ac3 bit allocation variables
Originally committed as revision 11194 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-12-09 03:23:04 +00:00
Justin Ruggles
66ecf18e38 cosmetics: rename ac3 tables
Originally committed as revision 11193 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-12-09 03:21:33 +00:00
Justin Ruggles
cc2a8443eb move some common values to ac3.h and utilize them
Originally committed as revision 9679 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-07-15 01:31:09 +00:00