Commit graph

47232 commits

Author SHA1 Message Date
Martin Storsjö
dd2e524ffa riscv: Use the correct path for including asm.S
Signed-off-by: Martin Storsjö <martin@martin.st>
2022-09-28 11:02:46 +03:00
Andreas Rheinhardt
2664b39d54 avocdec/snowenc: Fix left shift of negative number
Fixes the vsynth(1|2|_lena)-snow-ll FATE-tests.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-27 23:55:44 +02:00
Rémi Denis-Courmont
c03f9654c9 lavc/aacpsdsp: RISC-V V stereo_interpolate[0] 2022-09-27 13:19:52 +02:00
Rémi Denis-Courmont
a15edb0bc0 lavc/aacpsdsp: RISC-V V hybrid_synthesis_deint 2022-09-27 13:19:52 +02:00
Rémi Denis-Courmont
09f907999f lavc/aacpsdsp: RISC-V V hybrid_analysis_ileave 2022-09-27 13:19:52 +02:00
Rémi Denis-Courmont
15c3a0bd6e lavc/aacpsdsp: RISC-V V hybrid_analysis
This starts with one-time initialisation of the 26 constant factors
like  08edacc248. That is done with
the scalar instruction set. While the formula can readily be vectored,
the gains would (probably) be more than lost in transfering the results
back to FP registers (or suitably reshuffling them into vector
registers).

Note that the main loop could likely be scheduled sligthly better by
expanding the filter macro and interleaving loads with arithmetic.
It is not clear yet if that would be relevant for vector processing (as
opposed to traditional SIMD).

We could also use fewer vectors, but there is not much point in sparing
them (they are *all* callee-clobbered).
2022-09-27 13:19:52 +02:00
Rémi Denis-Courmont
e180326a0b lavc/aacpsdsp: RISC-V V mul_pair_single 2022-09-27 13:19:52 +02:00
Rémi Denis-Courmont
b0cacf4c3f lavc/aacpsdsp: RISC-V V add_squares 2022-09-27 13:19:52 +02:00
Rémi Denis-Courmont
453aba71e6 lavc/vorbisdsp: RISC-V V inverse_coupling
This uses the following vectorisation:

    for (i = 0; i < blocksize; i++) {
        ang[i] = mag[i] - copysignf(fmaxf(ang[i], 0.f), mag[i]);
        mag[i] = mag[i] - copysignf(fminf(ang[i], 0.f), mag[i]);
    }
2022-09-27 13:19:52 +02:00
Rémi Denis-Courmont
220dfd0945 lavc/fmtconvert: RISC-V V int32_to_float_fmul_array8 2022-09-27 13:19:52 +02:00
Rémi Denis-Courmont
47a10b9a99 lavc/fmtconvert: RISC-V V int32_to_float_fmul_scalar 2022-09-27 13:19:52 +02:00
Rémi Denis-Courmont
f41ae62f39 lavc/audiodsp: RISC-V V scalarproduct_int16 2022-09-27 13:19:52 +02:00
Rémi Denis-Courmont
f127a5d29d lavc/audiodsp: RISC-V V vector_clipf 2022-09-27 13:19:52 +02:00
Rémi Denis-Courmont
27da9514c3 lavc/audiodsp: RISC-V V vector_clip_int32 2022-09-27 13:19:52 +02:00
Rémi Denis-Courmont
1edac8eb46 lavc/pixblockdsp: RISC-V I get_pixels
Benchmarks on SiFive U74-MC (courtesy of Shanghai StarFive Tech):
get_pixels_c: 180.0
get_pixels_rvi: 136.7
2022-09-27 13:19:52 +02:00
Rémi Denis-Courmont
04d092e7d5 lavc/audiodsp: RISC-V F vector_clipf
RV64G supports MIN & MAX instructions natively only on floating point
registers, not general purpose ones. The later would require the Zbb
extension. Due to that, it is actually faster to perform the clipping
"properly" in FPU.

Benchmarks on SiFive U74-MC (courtesy of Shanghai StarFive Tech):
audiodsp.vector_clipf_c: 29551.5
audiodsp.vector_clipf_rvf: 17871.0

Also tried unrolling with 2 or 8 elements but it gets worse either way.
2022-09-27 13:19:52 +02:00
Lynne
543a46b4b2
opus: convert encoder and decoder to lavu/tx
This commit changes both the encoder and decoder to use the new lavu/tx code,
which has faster C transforms and more assembly optimizations.
2022-09-26 20:26:54 +02:00
Dmitry Rogozhkin
dd2ea014ef libavcodec/qsvenc: fixy typo for min/max qp reset
Fixes: 005c7a4 ("libavcodec/qsvenc: Add max/min qp reset support in qsvenc")

Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
2022-09-26 16:17:45 +08:00
Andreas Rheinhardt
a02a0e8db4 avcodec/avcodec: Deprecate lavc chroma pos API functions
avcodec_enum_to_chroma_pos() and avcodec_chroma_pos_to_enum()
deal with enum AVChromaLocation which is defined in lavu.
These functions are therefore replaced by
av_chroma_location_enum_to_pos() and av_chroma_location_pos_to_enum().
This commit provides the necessary deprecations. Also already make
these functions wrappers around the corresponding lavu functions
as not doing so would force one to disable deprecation warnings.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-26 03:02:49 +02:00
Andreas Rheinhardt
cf856d8957 avcodec/avcodec: Move AV_ER_* and FF_COMPLIANCE_* to defs.h
They are also frequently used in libavformat.
This change does not cause any breakage as avcodec.h
includes defs.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-26 02:51:46 +02:00
Paul B Mahol
0ca738673a avcodec/tiff: support multiple black levels 2022-09-25 18:34:49 +02:00
Paul B Mahol
1452445116 avcodec/tiff: implement FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM 2022-09-25 18:34:49 +02:00
Paul B Mahol
c0771055ec avcodec/pnmdec: implement FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM 2022-09-25 18:34:49 +02:00
Paul B Mahol
91897110b0 avcodec/tiff: improve color handling in DNG 2022-09-25 18:34:49 +02:00
Paul B Mahol
baf9099cf3 avcodec/tiff: add packed/planar 32bit float support 2022-09-25 18:34:48 +02:00
Andreas Rheinhardt
a7e54196cc avcodec/cbs: Only write extradata if there is something to write
It is e.g. legal for an ISOBMFF avcc to contain zero parameter sets.
In this case the annex B that we produce would be empty and therefore
useless. This happens e.g. with mov/frag_overlap.mp4 from the
FATE-suite.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-25 14:53:49 +02:00
Andreas Rheinhardt
7ae1c0dd3e avcodec/h264_redundant_pps_bsf: Don't remove PPS
There is no check for whether these supposedly redundant PPS
are actually redundant. One could check via memcmp which would
work in practice* (because all content buffers are initially
zero-allocated), but this is not portable as compilers may
trash padding inside structures as they wish.

In case the PPS is not really redundant the output is garbage.
This happens with several files from the FATE-suite. E.g.
h264-conformance/CVCANLMA2_Sony_C.jsv doesn't decode correctly
any more, whereas h264-conformance/CABA3_TOSHIBA_E.264 even
fails in ff_cbs_write_packet(), because the inferred value
of num_ref_idx_l0_active_minus1 mismatches with the value set
in the slice (this happens when num_ref_idx_l0_default_active_minus1
changes in the PPS; the value in the slice header is inferred from
the original PPS's num_ref_idx_l0_default_active_minus1).

*: Unless slice_group_id is used, i.e. unless slice_group_map_type
is six.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-25 14:53:45 +02:00
Andreas Rheinhardt
7cd252ee41 avcodec/parser: Remove declaration of inexistent function
Forgotten in e5af920309.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-24 20:25:19 +02:00
Michael Niedermayer
8008940da5
avcodec/dstdec: Check for overflow in build_filter()
Fixes: signed integer overflow: 1917019860 + 265558963 cannot be represented in type 'int'
Fixes: 48798/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DST_fuzzer-4833165046317056

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-09-24 18:31:06 +02:00
James Almer
1b47190c94 avcodec/opusdec: stop setting deprecated swr options
Signed-off-by: James Almer <jamrial@gmail.com>
2022-09-24 12:17:22 -03:00
Paul B Mahol
a166b8a19b avcodec: add FTR audio decoder and parser 2022-09-24 14:03:59 +02:00
Andreas Rheinhardt
2f9fa7e3e9 avcodec/mjpegbdec: Don't create unnecessary AVFrame reference
MJPEG-B is an intra-codec, so it makes no sense to keep the reference.
It is unused lateron anyway.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-24 12:23:33 +02:00
Paul B Mahol
a54da0831c avcodec/photocd: implement FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM 2022-09-24 12:23:33 +02:00
Paul B Mahol
a44a540ed1 avcodec/cri: implement FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM 2022-09-24 12:23:33 +02:00
Paul B Mahol
3e49c1e07a avcodec/xpmdec: implement FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM 2022-09-24 12:23:33 +02:00
Paul B Mahol
08f6b1e5b3 avcodec/xbmdec: implement FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM 2022-09-24 12:23:33 +02:00
Paul B Mahol
eb9045455d avcodec/hdrdec: implement FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM 2022-09-24 12:23:33 +02:00
Paul B Mahol
1e079525d5 avcodec/xwddec: implement FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM 2022-09-24 12:23:33 +02:00
Paul B Mahol
cea1e1f261 avcodec/exr: implement FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM 2022-09-24 12:23:32 +02:00
Paul B Mahol
3c16f9eb0d avcodec/qoidec: implement FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM 2022-09-24 12:23:32 +02:00
Andreas Rheinhardt
793282adc2 avcodec/jpeg2000dec: Implement FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM
This could be improved further by not allocating the buffers
that won't be needed lateron in the first place.

Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-23 22:17:10 +02:00
Andreas Rheinhardt
d5a0dc037d avcodec/jpeg2000dec: Set sample aspect ratio before getting buffer
That way the SAR will be automatically set on the AVFrame.

Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-23 21:58:18 +02:00
Paul B Mahol
ec8be8a913 avcodec/tiff: improve lut handling for DNG 2022-09-23 20:28:31 +02:00
Paul B Mahol
84f467454b avcodec: add APAC decoder 2022-09-23 20:26:28 +02:00
Anton Khirnov
c504fb8692 lavc/pthread_frame: always transfer stashed hwaccel state
Fixes assertion failures after avcodec_flush_buffers(), where
stashed hwaccel state is present, but prev_thread is NULL.

Found-by: Wang Bin <wbsecg1@gmail.com>
2022-09-23 16:06:27 +02:00
Tristan Matthews
e301143f96 opus_silk: reset midonly flag after skipping LBRR
Fix suggested by Mark Harris. Fixes ticket #9890

Simplified after feedback from Anton Khirnov.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2022-09-23 16:06:11 +02:00
James Almer
0922c6b01b x86/lpc: use fused negative multiply-add instructions where useful
Signed-off-by: James Almer <jamrial@gmail.com>
2022-09-22 18:17:26 -03:00
James Almer
0627e6d74c avcodec/lpc: zero the middle odd sample in the output
Signed-off-by: James Almer <jamrial@gmail.com>
2022-09-22 18:17:26 -03:00
James Almer
c8c4a162fc avcodec/lpc: use ptrdiff_t for length parameters
Signed-off-by: James Almer <jamrial@gmail.com>
2022-09-22 18:17:26 -03:00
James Zern
bd7d69fe35 avcodec/libvpxenc: add -min-gf-interval
this maps to the vpxenc argument with the same name and the
VP9E_SET_MIN_GF_INTERVAL codec control

Signed-off-by: James Zern <jzern@google.com>
Reviewed-by: Vignesh Venkatasubramanian <vigneshv@google.com>
2022-09-22 11:52:16 -07:00