Commit Graph

110438 Commits

Author SHA1 Message Date
Carl Eugen Hoyos 0b352e350e
avcodec/mjpegdec: support more pixel formats
Support pixel formats 0x11412100, 0x11311100, and 0x41211100, and add
logic to perform 4x horizontal upsampling. This should fix various JPEG
files found in Ticket #8930.

Co-authored-by: <leo.izen@gmail.com>
2023-04-24 16:22:52 -04:00
Anton Khirnov 11872522b1 fftools/ffmpeg_filter: reindent after previous commit 2023-04-24 16:56:06 +02:00
Anton Khirnov cc7a8ddf56 fftools/ffmpeg: move freeing a filtergraph into a separate function 2023-04-24 16:56:06 +02:00
Anton Khirnov eb9ce9de3b fftools/ffmpeg: move filtering functions to ffmpeg_filter 2023-04-24 16:56:06 +02:00
Anton Khirnov 0add05bd3a fftools/ffmpeg_mux_init: rename init_output_filter() to ost_add_from_filter()
The previous name is misleading, because the function does not actually
initialize any filters - it creates a new output stream and binds a
filtergraph output to it.
2023-04-24 16:56:06 +02:00
Anton Khirnov 4800b50258 fftools/ffmpeg: simplify init_output_filter() 2023-04-24 16:56:06 +02:00
Anton Khirnov ea4c42779b fftools/ffmpeg_mux_init: drop a redundant assignment
OutputFilter.format is initialized in ofilter_alloc().
2023-04-24 16:56:06 +02:00
Anton Khirnov 8b56480652 fftools/ffmpeg_filter: add a function for creating a filtergraph
Code creating a new filtergraph is currently duplicated in 3 places.
This commit unifies it and moves towards making filtergraphs more
self-contained.
2023-04-24 16:56:06 +02:00
Anton Khirnov 2104de13e9 fftools/ffmpeg: reindent after previous commit 2023-04-24 16:56:06 +02:00
Anton Khirnov 6cace17b0d fftools/ffmpeg_mux_init: drop useless new_stream_{data,unknown}
Their only function is checking that encoding was not specified for
data/unknown-type streams, but the check is broken because enc_ctx will
not be created in ost_add() unless a valid encoder can be found.

Add an actually working check for all types for which encoding is not
supported in choose_encoder().
2023-04-24 16:56:06 +02:00
Anton Khirnov ab0d2052a3 fftools/ffmpeg: remove unused function arguments 2023-04-24 16:56:06 +02:00
Anton Khirnov ecb44ca877 fftools/ffmpeg_mux_init: drop OutputStream.filters[_script]
They are not needed outside of ost_get_filters(), so make them stack
variables there.
2023-04-24 16:56:06 +02:00
Anton Khirnov 84e1e0fa73 fftools/ffmpeg_mux_init: move check for mixing simple/complex filters
Do it in ost_get_filters() together with other similar checks. Will be
useful in following commits.

Also, improve the log message.
2023-04-24 16:56:06 +02:00
Anton Khirnov 0fe5eaf69d fftools/ffmpeg_mux_init: consolidate handling -filter for audio/video 2023-04-24 16:56:06 +02:00
Anton Khirnov 03a465be57 fftools/ffmpeg: replace stream timebase with packet one where appropriate 2023-04-24 16:56:06 +02:00
Anton Khirnov 65b1350ad4 fftools/ffmpeg: stop setting InputStream.pts for streamcopy
It is not used in that case anymore.
Forgotten in d56652fdc8.
2023-04-24 16:56:06 +02:00
Anton Khirnov d8bc37f1f4 fftools/ffmpeg: stop using InputStream.pts in ts_discontinuity_detect()
ts_discontinuity_detect() is applied right after demuxing, while
InputStream.pts is a post-decoding timestamp, which may be delayed with
respect to demuxing by an arbitrary amount (e.g. depending on the thread
count when frame threading is used).
2023-04-24 16:56:06 +02:00
Anton Khirnov 37547e3acd fftools/ffmpeg_enc: move handling final frames to video_sync_process()
This code properly belongs there.
2023-04-24 16:56:06 +02:00
Anton Khirnov 403088cb67 fftools/ffmpeg_enc: rename next_picture to frame
The name is misleading, because it is not a picture in the sense of MPEG
terminology (which define "picture" as "frame or field"), but always a
full frame. 'next' is also redundant and/or misleading, because it is
the _current_ frame to be encoded.
2023-04-24 16:56:06 +02:00
Anton Khirnov c94e9d03b4 fftools/ffmpeg_enc: always use video frame durations when available
Previously they would only be used with trivial filtergraphs, because
filters did not handle frame durations. That is no longer true - most
filters process frame durations properly (there may still be some that
don't - this change will help finding and fixing them).

Improves output video frame durations in a number of FATE tests.
2023-04-24 16:56:06 +02:00
Anton Khirnov cd30492773 lavfi/avf_concat: rescale frame durations 2023-04-24 16:56:06 +02:00
Anton Khirnov 385430592a fftools/ffmpeg_filter: drop unused AUTO_INSERT_FILTER_INPUT() 2023-04-24 16:56:06 +02:00
Anton Khirnov a664ec94e0 fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration 2023-04-24 16:56:06 +02:00
Anton Khirnov 87b4453ec6 fftools/ffmpeg: stop printing PSNR information in status report
When an encoder exports sum-of-squared-differences information in
encoded packets, print_report() will print PSNR information in the
status line. However,
* the code computing PSNR assumes 8bit 420 video and prints incorrect
  values otherwise; there are no issues on trac about this
* only a few encoders (namely aom, vpx, mpegvideo, snow) export this
  information; other often-used encoders such as libx26[45] do not
  export this, even though they could

This suggests that this feature is not useful and it is better to remove
it rather than spend effort on fixing it.
2023-04-24 16:53:59 +02:00
Haihao Xiang 2aad9765ef lavfi/overlay_vaapi: set input region for overlay video to NULL
Otherwise main and overlay videos share the same input region. Note NULL
pointer imples the whole overlay video will be processed.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-04-24 13:24:41 +08:00
Sil Vilerino a9a2ddaea8 lavu/hwcontext_qsv: Update after adding support for VAAPI on Windows
- qsv_internal.h: Remove unnecessary include va_drm.h
- qsv_internal.h: Enable AVCODEC_QSV_LINUX_SESSION_HANDLE on Linux/VA only
- hwcontext_qsv.c: Do not allow child_device_type VAAPI for Windows until
  support is added, keep D3D11/DXVA2 as more prioritary defaults.

Initial review at https://github.com/intel-media-ci/ffmpeg/pull/619/

Signed-off-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
Reviewed-by: Wu, Tong1 <tong1.wu@intel.com>
2023-04-24 13:24:41 +08:00
Sil Vilerino 5ff1430452 fftools/ffmpeg_opt: Document VAAPI -device usage for DirectX Adapter
Initial review at https://github.com/intel-media-ci/ffmpeg/pull/619/

Signed-off-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
Reviewed-by: Wu, Tong1 <tong1.wu@intel.com>
2023-04-24 13:24:41 +08:00
Sil Vilerino d54127c41a lavu/hwcontext_vaapi: Add Windows/VAAPI support with vaGetDisplayWin32
Libva 2.17+ adds a new libva-win32 node and Mesa 22.3 adds a VAAPI driver
based on Direct3D 12 for Windows. Both of them are available at:
https://www.nuget.org/packages/Microsoft.Direct3D.VideoAccelerationCompatibilityPack

Initial review at https://github.com/intel-media-ci/ffmpeg/pull/619/

Signed-off-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
Reviewed-by: Wu, Tong1 <tong1.wu@intel.com>
2023-04-24 13:24:41 +08:00
Wang Yaqiang 734a61d282 avformat/movenc: fixed fmp4 packets containing incorrect flags after transcoding
When write multi-trun box, the MOV_TRUN_FIRST_SAMPLE_FLAGS flag
need judge by first param, not 0.
If the original video contains consecutive I frames,
this will cause the packets of fmp4 have error sample_flags ,
and then incorrect keyframes were generated,
and then error packet will be seeked.

Signed-off-by: Wang Yaqiang <wangyaqiang03@kuaishou.com>
Signed-off-by: Steven Liu <liuqi05@chinaffmpeg.org>
2023-04-24 09:46:10 +08:00
James Almer 9a258eefae fate/jpeg2000: add missing dependecy checks
Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-23 18:54:43 -03:00
Paul B Mahol ef338cfd7b avfilter/af_afir: fix IR switching with different lengths 2023-04-23 23:40:42 +02:00
Thilo Borgmann 4dd3f2098c doc/developer: mention samples-request for FATE upload requests 2023-04-23 21:45:40 +02:00
Zhao Zhili b56aca9b42 fftools/ffmpeg_mux: fix reporting muxer EOF as error
Fix #10327.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-04-23 21:23:11 +08:00
Pierre-Anthony Lemieux 7ecf1bff6d
fate/jpeg2000: add JPEG 2000 tests using ITU/ISO conformance materials
Adds JPEG 2000 decoder tests using materials from the conformance suite specified in
Rec. ITU-T T.803 | ISO/IEC 15444-4.

The test materials are available at https://gitlab.com/wg1/htj2k-codestreams

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2023-04-22 15:57:41 -07:00
caleb b9c42cdf8d
avcodec/jpeg2000dec: add support for HTJ2K block decoding
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2023-04-22 15:57:40 -07:00
caleb 4a466aab30
avcodec/jpeg2000dec: move decoder structs to a header file
Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
2023-04-22 15:57:35 -07:00
Michael Niedermayer cadd7e7a75
avcodec/vorbisdec: Check codebook float values to be finite
Fixes: Timeout
Fixes: 55116/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VORBIS_fuzzer-4572159970508800

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-22 23:21:03 +02:00
Michael Niedermayer 99dc751782
tools/target_dec_fuzzer: Adjust threshold for EXR
Fixes: Timeout
Fixes: 55106/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5052199338377216

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-22 23:20:06 +02:00
Michael Niedermayer 38adbc6eeb
avcodec/g2meet: Replace fake allocation avoidance for framebuf
framebuf is only allocated when the new width/height are larger than the old
but nothing sets the old so its always allocated.
Use av_fast_mallocz() instead.

Fixes: Timeout
Fixes: 55094/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G2M_fuzzer-5116909932904448

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-22 23:19:16 +02:00
Michael Niedermayer eddf7e2a3e
avutil/tx_priv: Use unsigned in BF() to avoid signed overflows
Fixes: signed integer overflow: 100183269 - -2132769113 cannot be represented in type 'int'
Fixes: 55063/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5039294027005952

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-04-22 21:17:07 +02:00
Paul B Mahol 014c02d43b avfilter/af_anlms: simplify query formats 2023-04-22 18:12:47 +02:00
James Almer 41bbf2e372 fate/h264: test disabling cropping
Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-22 11:20:58 -03:00
James Almer 95a78c08c1 avcodec/hevcdec: further constrain some slice header field values
num_ref_idx_l0_active_minus1, num_ref_idx_l1_active_minus1,
num_ref_idx_l0_default_active_minus1, and num_ref_idx_l1_default_active_minus1
are all in the range 0 to 14, inclusive.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-22 11:15:06 -03:00
Jun Zhao 73ddcad990 lavc/libopenh264: refine the code
refine the code

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2023-04-22 18:39:27 +08:00
Jun Zhao de5e2570f0 lavc/libopenh264: Support full range videos in transcoding
Support full range videos when transcoding, enabled the
YUVJ420P to avoid auto scale from YUVJ420P to YUV420P

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2023-04-22 18:39:27 +08:00
James Almer 86645bf0a6 avcodec/pcm_rechunk_bsf: assert that in_pkt is empty after merging its data into out_pkt
If it's not empty here, then a leak would ocurr immediately after.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-21 17:14:36 -03:00
Leo Izen 453b524974
fate: add tests for RGB jpegs
Added framecrc tests for RGB JPEGs to verify future changes to the
decoder.
2023-04-21 09:55:12 -04:00
Leo Izen 869248c053
avcodec/mjpegdec: fix remaining RGB JPEGs
The change introduced in b18a9c2971
created a regression for non-subsampled progressive RGB jpegs. This
should fix that.

Additionally, this should fix other RGB JPEGs broken before the recent
patches, such as those in Trac issue #10190.
2023-04-21 09:55:08 -04:00
James Almer 0e1745774e fftools/ffprobe: fix printing AVFrame.crop_right
Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-21 09:25:53 -03:00
Steven Liu 4570ba5d86 fate/png-icc-parse: update ref data
When enable lcms2, the fate-png-icc-parse will get error bellow.
TEST    png-icc-parse
This because updated how PNG handles colors (no
longer using mastering display metadata for that).

Reviewed-by: Leo Izen <leo.izen@gmail.com>
Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
2023-04-21 14:06:37 +08:00