Justin Ruggles
e7536ac567
Count bits for fixed parameters at start of encoding rather than in every
...
frame.
Originally committed as revision 26038 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
e86ea34dad
Use a LUT for number of exponent groups. This avoids recalculating it for
...
every block and channel for every frame.
Originally committed as revision 26037 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
834550ea0d
Speed up group minimum and group output calculations for EXP_D25 and EXP_D45
...
in encode_exponents_blk_ch() by removing the inner loops. This is about 30-40%
faster for the modified sections.
Originally committed as revision 26036 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
cdedf7e625
Convert a for() loop into a while() loop for the downward part of the exponent
...
delta limiting.
Originally committed as revision 26035 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
27af78cf0e
Redesign encode_exponents_blk_ch() so that duplicate exponent sets are no
...
longer required. This gets rid of the temp buffer as well as encoded_exp in
AC3EncodeContext. It also allows for skipping the exponent grouping for
EXP_D15. 56% faster in encode_exponents_blk_ch().
Originally committed as revision 26034 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
8846ee54ad
Use optimized function DSPContext.sad[0]() instead of calc_exp_diff().
...
90% faster compute_exp_strategy().
Originally committed as revision 26033 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
7786c384f6
cosmetics: pretty-printing after last commit
...
Originally committed as revision 26031 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
89bedc4d2e
Add a goto for init failure instead of duplicate calls to ac3_encode_close().
...
Originally committed as revision 26030 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
c41ac4f82e
Use pre-allocated temp buffers in mdct512().
...
5% faster in function.
Originally committed as revision 26029 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
e29065f7bf
Write results of post-rotation complex multiply directly to output.
...
2% faster in function mdct512().
Originally committed as revision 26028 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
9d8533368f
Use memcpy() instead of a for loop in mdct512().
...
8% faster in function.
Originally committed as revision 26027 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
b6f6204db9
Allocate all large per-channel arrays using av_malloc().
...
Decreases memory usage for less than 6 channels.
Originally committed as revision 26026 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
aa645b9888
Make windowed_samples 16-byte aligned.
...
This will allow future SIMD optimization of the window function.
Originally committed as revision 26025 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
e8d21fba3f
Allocate planar_samples using av_mallocz().
...
Lowers memory usage when encoding less than 6 channels.
Originally committed as revision 26024 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
171bc51c9b
Allocate bap and bap1 buffers using av_malloc().
...
This reduces the memory footprint when using less than 6 channels.
Modify bit allocation to swap the 2 buffers instead of using memcpy() and use
per-block pointers for bap. This is slightly faster (0.3%) in function
cbr_bit_allocation().
Originally committed as revision 26023 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
1c3e117e0b
Remove last_samples[] and copy directly from planar_samples[].
...
Avoids memcpy that was used to store last samples for next frame.
Approx. 3% faster in function deinterleave_input_samples() and reduces memory
usage by 3kB.
Originally committed as revision 26021 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
7eeca961e3
Remove unneeded line. key_frame is already set to 1 in avcodec_alloc_frame().
...
Originally committed as revision 26020 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
2d82d9b1df
cosmetics: comment clean-up and misc cosmetics
...
Originally committed as revision 26019 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
5901cebecd
Separate most of the per-block arrays into a separate per-block struct.
...
Originally committed as revision 26018 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
cb6247cb30
Split bit allocation search into a separate function.
...
Originally committed as revision 26017 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
06f6f78578
10l: fix typo in compute_exp_strategy()
...
Originally committed as revision 26013 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
266d24be4a
Move large arrays to AC3EncodeContext rather than passing them around.
...
Originally committed as revision 26012 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
7da4dc17d9
cosmetics: line wrap and spacing
...
Originally committed as revision 26011 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
a0d763fc88
Use a single value for SNR offset in the bit allocation search rather than
...
the separate coarse and fine values.
Originally committed as revision 26010 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
70fcd7ea80
Change bit_alloc() to return the mantissa bit count.
...
Originally committed as revision 26009 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
937cd1467c
cosmetics: alignment and line wrap after last commit
...
Originally committed as revision 26008 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
359c1d1926
Move bit counts to AC3EncodeContext.
...
Originally committed as revision 26007 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
793bbf9544
Split out setting of bit allocation parameters to a separate function.
...
Th new function only needs to be called at initialization because bit
allocation parameters currently do not change during encoding.
Originally committed as revision 26003 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
8999944ecb
Split out counting of frame bits into a separate function.
...
Originally committed as revision 26002 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
33a7d549e8
cosmetics: vertical alignment
...
Originally committed as revision 26001 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
d3325d555b
Only calculate num_exp_groups once.
...
Originally committed as revision 26000 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
dc0bc0f84e
Check for bit allocation error in ac3_encode_frame().
...
Move error log printout to ac3_encode_frame().
Originally committed as revision 25999 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
f94bacc538
Split out grouping of exponents into a separate function.
...
Originally committed as revision 25998 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
b6a1e5236e
Split out mantissa quantization into separate functions.
...
Originally committed as revision 25997 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
5b44ede0ba
cosmetics: rearrange some functions
...
Originally committed as revision 25996 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
d7da80806c
Reverse the exponent & exponent strategy array arrangement to simplify the
...
per-channel exponent strategy decision. This will also make it easier to
plug-in other exponent strategy algorithms.
Originally committed as revision 25995 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
67d979fede
Move writing of frame to the output bitstream to a separate function.
...
Originally committed as revision 25994 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
084f5c5afe
cosmetics: remove a comment and just spacing
...
Originally committed as revision 25993 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
160d85f5b0
Split frame size adjustment into a separate function.
...
Originally committed as revision 25992 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
dfdf73eb1a
Split exponent processing into separate functions.
...
Originally committed as revision 25991 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
0a0a8500fb
Split applying of MDCT into several separate functions.
...
Originally committed as revision 25990 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
4acc790f3c
Split input sample deinterleaving into a separate function.
...
Originally committed as revision 25989 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
152cc52803
Separate functionally different calculations in ac3_encode_frame().
...
Originally committed as revision 25988 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
98f6ee4453
cosmetics: rename 2 variables
...
Originally committed as revision 25987 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
12ed622699
Deinterleave whole frame at once instead of per-block.
...
This reduces the amount of memcpy() by using pointers to overlap samples for
successive blocks rather than copying.
Originally committed as revision 25986 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
e0685bc98f
cosmetics: add & alter some comments
...
Originally committed as revision 25985 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
282255bbd2
Split setting of bandwidth into a separate function.
...
Originally committed as revision 25984 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
e35c984a5d
Move setting of bitstream_id and bitstream_mode to ac3_encode_init().
...
Originally committed as revision 25983 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
ddf63d37b8
Improve ac3_encode_init() error reporting.
...
Return AVERROR(EINVAL) instead of -1. Propogate errors from called functions.
Add some error log printouts.
Originally committed as revision 25982 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
b64d842c1d
cosmetics: indent after last commit
...
Originally committed as revision 25981 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago