Commit Graph

33468 Commits

Author SHA1 Message Date
Rostislav Pehlivanov
033e58941e aaccoder: rewrite PNS implementation
This commit rewrites the PNS implementation and significantly
improves sonic quality.

The previous implementation marked an incredibly big amount
of SFBs to predict when there was no need for this and this
resulted in quite a large amount of artifacts. Also the
quantization was incorrect (av_clip(4+log2f(...))) which
led to 3x the intensity for PNS values leading to even more
artifacts.

This commit rewrites the PNS search function and introduces
a major change: the PNS values are synthesized and are compared
to the current coefficients in addition to passing through
the revised checks to see whether PNS can be used.

This decreases distortions and makes the current PNS implementation
mainly focused on replacing any low-power non-zero bands as well
as adding any zeroed bands back.

The current encoder's performance is enough (especially with
IS) so PNS isn't really required except to fill in the occasional
few bands as well as extend any zeroed high frequency, so this
combination which is already enabled by default works
to get as much quality as it can within the bits allowed.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2015-09-06 15:30:26 +01:00
Rostislav Pehlivanov
8848c8440e aacenc_pred: disable PNS SFBs and disable right predictors with IS
Since PNS generates coefficients it doesn't make sense to send
the predicted ones as well. Also the specifications explicitly
state to disable right channel IS predictors.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2015-09-06 15:30:26 +01:00
Rostislav Pehlivanov
a71f7de95b aacenc_is: ignore PNS band types
It's better to trust that the coefficients generated will be
closer than the coefficients derived, and the new PNS implementation
makes sure that this happens.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2015-09-06 15:30:26 +01:00
Rostislav Pehlivanov
b9b1fd1183 aaccoder: use roundf() instead of ceilf()
The specifications explicitly state to use roundf() which
also rounds half-integer values away from zero.
This does fix a few IS artifacts.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2015-09-06 15:30:26 +01:00
Rostislav Pehlivanov
92aa3e7fb2 aacenc: copy PRNG from the decoder
Needed for the following PNS commits.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2015-09-06 15:30:25 +01:00
Hendrik Leppkes
34e85cb340 avcodec/vorbis: remove avpriv vorbis parser cruft
It was replaced by a public API
2015-09-06 16:25:58 +02:00
Hendrik Leppkes
2cad7eebc1 avcodec/flac: remove avpriv parsing API cruft 2015-09-06 16:25:56 +02:00
Hendrik Leppkes
eb011f73ca avcodec/alac: remove dead code cruft
The output is always planar since two major bumps, remove all code
related to packed output.
2015-09-06 16:25:55 +02:00
Rodger Combs
d2d020bb32 avcodec/htmlsubtitles: handle leading whitespace before tag names
This fixes cases like `</ font>`.

Signed-off-by: Clément Bœsch <u@pkh.me>
2015-09-06 15:48:34 +02:00
Clément Bœsch
db18b3d6e6 avcodec/samidec: small indent fix 2015-09-06 14:06:44 +02:00
Clément Bœsch
26786f43d7 avcodec/htmlsubtitles: drop avcodec dependency 2015-09-06 13:39:04 +02:00
Yayoi
87f90be4f2 avcodec/samidec: use ff_htmlmarkup_to_ass()
Signed-off-by: Clément Bœsch <u@pkh.me>
2015-09-06 13:29:28 +02:00
Yayoi
50332f8a6b avcodec/srtdec: factor out HTML parsing code
This code will be used in SAMI decoder in a later commit.

Signed-off-by: Clément Bœsch <u@pkh.me>
2015-09-06 13:07:44 +02:00
Michael Niedermayer
8d860f9a77 avcodec/x86/w64xmmtest: Fix another build failure
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-05 22:15:53 +02:00
Hendrik Leppkes
8042d6c492 avcodec: remove old_codec_ids.h from SKIPHEADERS as well 2015-09-05 21:55:59 +02:00
Hendrik Leppkes
393b472362 avcodec: fix make install after old_codec_ids.h removal 2015-09-05 21:54:53 +02:00
Ronald S. Bultje
086c9b78d4 vp9: fix rounding error in idct_8x8_ssse3. 2015-09-05 15:50:02 -04:00
Ronald S. Bultje
ae9344cb9f vp9: check return value of ff_thread_ref_frame().
Fixes CID 1322309.
2015-09-05 15:50:01 -04:00
Ronald S. Bultje
ef8740d8e5 vp9: fix type of iadst4_1d intermediates.
Fixes integer overflows for extreme coefficient values in 10/12bpp content.
2015-09-05 15:50:01 -04:00
Ronald S. Bultje
342bca7f02 vp9: fix integer overflow in 10/12bpp DC-only calculation. 2015-09-05 15:50:01 -04:00
Ronald S. Bultje
1f7871ec42 vp9: fix edge copy for 10/12bpp frames. 2015-09-05 15:50:01 -04:00
Ronald S. Bultje
9cdeb105a6 vp9: do unscaled MC in scaled path if size of this reference matches.
This can happen if we do bidirectional MC, where one reference has the
same size as the current frame, but the other one doesn't.
2015-09-05 15:50:01 -04:00
Ronald S. Bultje
873dbc6758 vp9: sync segmentation.absolute_vals between threads. 2015-09-05 15:50:00 -04:00
Ronald S. Bultje
3d7173b509 vp9: always sync segmentation.feat between threads. 2015-09-05 15:50:00 -04:00
wm4
89b0a9f3fa avcodec/vdpau: remove incompatible-libav-abi hack from vdpau_render_state struct 2015-09-05 16:45:26 -03:00
Hendrik Leppkes
160e92c8bf Merge commit 'e88103a7f92cf27a2868b50acc8a9912f6088249'
* commit 'e88103a7f92cf27a2868b50acc8a9912f6088249':
  Bump major versions of all libraries

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 21:35:46 +02:00
Hendrik Leppkes
590ea32e54 Postpone removal of API changes from within the last two years 2015-09-05 21:21:20 +02:00
Hendrik Leppkes
24e3bac52a avcodec: remove deprecated codec id aliases 2015-09-05 21:15:58 +02:00
Hendrik Leppkes
76cac7ed45 avcodec: remove deprecated old video encode API 2015-09-05 21:15:57 +02:00
Hendrik Leppkes
64c33f9624 avcodec: remove deprecated old audio encode API 2015-09-05 21:15:55 +02:00
Hendrik Leppkes
2c8ee2547e avcodec: remove deprecated old audio decode API 2015-09-05 21:15:54 +02:00
James Almer
251fb7dcd4 avcodec: remove FF_API_DV_FRAME_PROFILE cruft
Signed-off-by: James Almer <jamrial@gmail.com>
2015-09-05 14:16:16 -03:00
Michael Niedermayer
998fa4fa30 avcodec/libutvideodec: remove AVFrame->reference usage, otherwise the code does not build
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-05 18:25:24 +02:00
James Almer
4a447e3e69 avcodec/ac3: sync AC3HeaderInfo struct with the fork
Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-09-05 13:24:52 -03:00
Hendrik Leppkes
2df52088ef Merge commit '4e649debcf7f71d35c6b38cdb7ee715eba95d64a'
* commit '4e649debcf7f71d35c6b38cdb7ee715eba95d64a':
  Postpone API-incompatible changes until the next bump

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 17:52:10 +02:00
Hendrik Leppkes
b9fd813351 Merge commit '8f12ef9860d0e164e4647fd5d5cebdb3cfb34a79'
* commit '8f12ef9860d0e164e4647fd5d5cebdb3cfb34a79':
  lavu: Drop deprecated duplicated AVFrame/AVCodecContext parameters

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 17:31:45 +02:00
Hendrik Leppkes
41194f065c Merge commit 'cad40a3833ad81a352e7657ec6f7d637cea3b798'
* commit 'cad40a3833ad81a352e7657ec6f7d637cea3b798':
  lavc: Drop deprecated deinterlace module

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 17:06:14 +02:00
Hendrik Leppkes
7f6b794da0 Merge commit '069713aa4b137781e270768d803b1f7456daa724'
* commit '069713aa4b137781e270768d803b1f7456daa724':
  lavc: Drop deprecated thread opaque and codec pkt

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 17:03:44 +02:00
Hendrik Leppkes
4eb86b83a4 Merge commit '9f90b24877016e7140b9b14e4b1acee663bb6d8a'
* commit '9f90b24877016e7140b9b14e4b1acee663bb6d8a':
  lavc: Drop deprecated get_buffer related functions

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 16:59:23 +02:00
Hendrik Leppkes
83a5df54ea Remove left-over FF_API_DESTRUCT_PACKET cruft 2015-09-05 16:51:53 +02:00
Hendrik Leppkes
87c8812270 Merge commit '01bcc2d5c23fa757d163530abb396fd02f1be7c8'
* commit '01bcc2d5c23fa757d163530abb396fd02f1be7c8':
  lavc: Drop deprecated destruct_packet related functions

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 16:50:09 +02:00
Hendrik Leppkes
b27ddffbfb Merge commit 'dc70c19476e76f1118df73b5d97cc76f0e5f6f6c'
* commit 'dc70c19476e76f1118df73b5d97cc76f0e5f6f6c':
  lavc: Drop deprecated request_channels related functions

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 16:42:44 +02:00
Michael Niedermayer
c41a59330f avcodec/rawenc: Use AVFrame parameters instead of AVCodecContext
This allows encoding raw frames with changing dimensions

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-05 11:56:23 +02:00
Rostislav Pehlivanov
e3faad811e aacenc_tns: adjust coefficient calculation, add double filter support
This commit improves the TNS implementation to the point where it's
actually usable and very rarely results in nastyness (in all bitrates
except extremely low bitrates it's increasing the quality and prevents
some distortions from the coder being audiable).

Also adds a double filter support which is only used if the energy
difference between the top and bottom of the SFBs is above the
thresholds defined in the header file. Looking at the bitstream
that fdk_aac generates it sometimes used a double filter despite
the specs stating that a single filter should be enough for almost
all cases and purposes.

Unlike FAAC or fdk_aac we sometimes use a reverse filter in case
the energy difference isn't enought to use a double filter. This
actually works better.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2015-09-05 09:08:30 +01:00
Rostislav Pehlivanov
7591f8319b lpc: increase error array size of ff_lpc_calc_ref_coefs_f by one
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2015-09-05 08:51:19 +01:00
Rostislav Pehlivanov
4565611b04 aacenc_is: add a flag to use pure coefficients instead
This commit adds a flag to use the pure coefficients instead
of the processed ones (sce->coeffs). This is needed because
IS will apply the changes to the coefficients immediately
before the adjust_common_prediction function and it doesn't
make sense to measure stereo channel coefficient difference
when one of the channels coefficients are all zero.

Therefore add a flag to use pure coefficients in that case.
TNS is the only thing touching the coefficients before IS
so common window prediction will not take that into account
but the effect of the TNS filter per coefficient can be small
(a few percent) so to some approximation it's fine to just
ignore that.

Also fixed a small error which doesn't alter the results
that much. pow(sqrt(number), 3.0/4.0) == pow(number, 3.0/8.0) !=
pow(number, 3.0/4.0).

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2015-09-05 08:32:09 +01:00
Michael Niedermayer
a87ada53c3 avcodec/jpeg2000dec: Initialize ret to avoid warning and make the code more robust
"Fixes" CID1322361

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-05 00:38:21 +02:00
Michael Niedermayer
9e70475551 avcodec/jpeg2000dec: Assert that step_x/y are valid
Fixes CID1322304, CID1322305

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-05 00:37:53 +02:00
Michael Niedermayer
205c31b301 avcodec/hapdec: Check section_size for non negativity in parse_section_header()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-05 00:37:53 +02:00
Carl Eugen Hoyos
f253c34175 lavc/j2kenc: Remove experimental flag.
The encoder produces valid and - if requested - lossless files.
2015-09-04 23:48:32 +02:00