1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00
Commit Graph

48211 Commits

Author SHA1 Message Date
Lynne
20de09a6de
h264_ps: expose scaling_matrix_present_mask
Vulkan requires it.
It technically also requires use_default_scaling_matrix_mask,
but we can just be explicit and give it the matrix we fill in as-non
default.
2023-05-29 00:41:30 +02:00
Lynne
d13b1c42f6
h264_ps: expose bit rate and CPB size fields 2023-05-29 00:41:30 +02:00
Lynne
de6fce727c
h264_ps: expose max_dec_frame_buffering 2023-05-29 00:41:30 +02:00
Lynne
1f66e3347d
h264_ps: comment pic_order_present better
The official name which CBS uses is bottom_field_pic_order_in_frame_present_flag.
2023-05-29 00:41:29 +02:00
Lynne
6718b37e5d
h264_ps: set pic_scaling_matrix_present_flag 2023-05-29 00:41:29 +02:00
Lynne
02f38af2dd
h264_ps: expose pps_id 2023-05-29 00:41:29 +02:00
Lynne
317fa3bd1d
h2645_vui: expose aspect_ratio_info_present_flag 2023-05-29 00:41:28 +02:00
Lynne
dc2694557d
h2645_vui: expose aspect_ratio_idc 2023-05-29 00:41:28 +02:00
Lynne
b6a6e2b19d
lavc/decode: allow to allocate hwaccel_priv_data early 2023-05-29 00:41:27 +02:00
Anton Khirnov
8b23644408
lavc/pthread_frame: add support for thread-safe hwaccels 2023-05-29 00:41:27 +02:00
Anton Khirnov
3d2e1aa324
lavc/decode: stop duplicating code from hwaccel_uninit() 2023-05-29 00:41:27 +02:00
Anton Khirnov
a4611e3170
lavc/decode: pass AVHWAccel instead of AVCodecHWConfigInternal to hwaccel_init()
The only thing besides the hwaccel that this function uses from
AVCodecHWConfigInternal is the pixel format, which should always match
the hwaccel one.

Will be useful in following commits.
2023-05-29 00:41:25 +02:00
yuanhecai
f6077cc666
avcodec/la: Add LSX optimization for h264 qpel.
./configure --disable-lasx
ffmpeg -i 1_h264_1080p_30fps_3Mbps.mp4 -f rawvideo -y /dev/null -an
before: 214fps
after:  274fps

Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-05-25 21:05:01 +02:00
Lu Wang
8815a7719e
avcodec/la: Add LSX optimization for h264 chroma and intrapred.
./configure --disable-lasx
ffmpeg -i 1_h264_1080p_30fps_3Mbps.mp4 -f rawvideo -y /dev/null -an
before: 199fps
after:  214fps

Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-05-25 21:04:56 +02:00
Hao Chen
7845b5ecd6
avcodec/la: Add LSX optimization for loop filter.
Replaced function(LSX is sufficient for these functions):
ff_h264_v_lpf_chroma_8_lasx
ff_h264_h_lpf_chroma_8_lasx
ff_h264_v_lpf_chroma_intra_8_lasx
ff_h264_h_lpf_chroma_intra_8_lasx
ff_weight_h264_pixels4_8_lasx
ff_biweight_h264_pixels4_8_lasx

./configure --disable-lasx
ffmpeg -i 1_h264_1080p_30fps_3Mbps.mp4 -f rawvideo -y /dev/null -an
before: 161fps
after:  199fps

Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-05-25 21:04:43 +02:00
Shiyou Yin
e1b6ecd20a
avcodec/la: add LSX optimization for h264 idct.
loongson_asm.S is LoongArch asm optimization helper.
Add functions:
  ff_h264_idct_add_8_lsx
  ff_h264_idct8_add_8_lsx
  ff_h264_idct_dc_add_8_lsx
  ff_h264_idct8_dc_add_8_lsx
  ff_h264_idct_add16_8_lsx
  ff_h264_idct8_add4_8_lsx
  ff_h264_idct_add8_8_lsx
  ff_h264_idct_add8_422_8_lsx
  ff_h264_idct_add16_intra_8_lsx
  ff_h264_luma_dc_dequant_idct_8_lsx
Replaced function(LSX is sufficient for these functions):
  ff_h264_idct_add_lasx
  ff_h264_idct4x4_addblk_dc_lasx
  ff_h264_idct_add16_lasx
  ff_h264_idct8_add4_lasx
  ff_h264_idct_add8_lasx
  ff_h264_idct_add8_422_lasx
  ff_h264_idct_add16_intra_lasx
  ff_h264_deq_idct_luma_dc_lasx
Renamed functions:
  ff_h264_idct8_addblk_lasx ==> ff_h264_idct8_add_8_lasx
  ff_h264_idct8_dc_addblk_lasx ==> ff_h264_idct8_dc_add_8_lasx

./configure --disable-lasx
ffmpeg -i 1_h264_1080p_30fps_3Mbps.mp4 -f rawvideo -y /dev/null -an
before: 155fps
after:  161fps

Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-05-25 21:04:25 +02:00
Paul B Mahol
c6b6356635 avformat/gifdec: switch to using gif parser
Update fate test, more correct as last packet is not truncated.
2023-05-25 19:51:56 +02:00
James Almer
97f4263457 avcodec/av1dec: convert to receive_frame()
This removes the overhead of inserting the av1_frame_split bsf as part of the
decoding process.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-25 11:21:35 -03:00
Haihao Xiang
8e2547ebb2 lavc/qsvenc: the height is aligned to 32 for AV1
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-05-25 09:04:13 +08:00
Haihao Xiang
943a42fc54 lavc/qsvenc: make sure continuous allocation
Intel MediaSDK and oneVPL expect continuous allocation for data[i],
however there are mandatory padding bytes between data[i] and data[i+1].
when calling av_frame_get_buffer. This patch removes all extra padding
bytes.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-05-25 09:04:13 +08:00
Haihao Xiang
cf79dab8df lavc/qsvenc: avoid data copy if possible
The data copy is unnecessary for packed formats when frame width and
height are aligned

For example:
$ ffmpeg -f lavfi -i testsrc=size=1920x1088 -vf "format=yuyv422" -c:v hevc_qsv -f null -

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-05-25 09:04:13 +08:00
Haihao Xiang
cfdfd6aa72 lavc/qsvenc: use the right alignment instead of hard coded value
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-05-25 09:04:13 +08:00
Haihao Xiang
2b0fe52967 lavc/qsv: fallback to the default mfx implementation for internal session on Windows
The mfx implementation based on D3D11 is expected for an internal
session on Windows, however sometimes this implemntation is not
supported [1]. A fallback to the default mfx implementation is added in
this patch.

[1] https://github.com/intel/cartwheel-ffmpeg/issues/246

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-05-25 09:04:13 +08:00
James Almer
f209614290 avcodec/libdav1d: only return EAGAIN when there are no buffered packets
Fixes decoding packets containing split temporal units, as generated for example
by the av1_frame_split bsf.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-22 16:19:10 -03:00
Michael Niedermayer
43e5e2e423
avcodec/bonk: Avoid undefined integer overflow in predictor_calc_error()
Fixes: signed integer overflow: -159584 * 5105950 cannot be represented in type 'int'
Fixes: 55165/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BONK_fuzzer-5796023719297024

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-05-22 02:49:59 +02:00
Paul B Mahol
d912ff19c5 avcodec/fitsenc: mark output packets as keyframes 2023-05-21 20:51:55 +02:00
Paul B Mahol
4d4aed2815 avcodec/fitsdec: fix decoder class category 2023-05-21 20:31:46 +02:00
Paul B Mahol
fcabfcbf6f avcodec/wavpackenc: unbreak encoding 8bit pcm
Otherwise the reference decoder reports crc errors.
2023-05-21 11:30:12 +02:00
Paul B Mahol
ddc176d0ee avcodec/elbg: fix integer overflows
Fixes #9977
2023-05-21 10:50:59 +02:00
Paul B Mahol
d81b6cbd42 avcodec/gif_parser: fix possible wrong splitting of frames
And properly signal keyframes.
2023-05-21 10:48:14 +02:00
Rick Kern
247e977953 lavc/videotoolboxenc: warn when alpha quality not set
Added a warn log when alpha quality cannot be set, but continue encoding.

Signed-off-by: Rick Kern <kernrj@gmail.com>
2023-05-20 11:42:12 -04:00
Rick Kern
902c949d30 lavc/videotoolboxenc: better compat_keys docs
Added more specific docs about when to use compat_keys, and how to
add new constants.

Signed-off-by: Rick Kern <kernrj@gmail.com>
2023-05-20 11:42:12 -04:00
Paul B Mahol
8980c1313b avcodec/ccaption_dec: simplify init function 2023-05-20 13:06:40 +02:00
James Almer
1b05d27346 avcodec/libdav1d: export decoder frame delay
As this is an AV_CODEC_CAP_OTHER_THREADS decoder, threading is handled by the
underlying library. In this case, the frame delay is calculated by libdav1d
based on the values from avctx->thread_count and the private max_frame_delay
option.
Export said delay reported by the library in AVCodecContext.delay

Reviewed-by: Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-19 15:29:31 -03:00
Rick Kern
c789a2324a lavc/videotoolboxenc: better compat_keys documentation
Added documentation that describes when compat_keys should be used,
and why it exists.

Signed-off-by: Rick Kern <kernrj@gmail.com>
2023-05-19 09:48:26 -04:00
xufuji456
5cd304298e avcodec/videotoolboxenc: add low-latency encoding
When using low-latency mode, it eliminates frame reordering
and follows a one-in-one-out encoding mode

Signed-off-by: xufuji456 <839789740@qq.com>
Signed-off-by: Rick Kern <kernrj@gmail.com>
2023-05-19 09:40:28 -04:00
Zhao Zhili
47430a3cb1 avcodec/cavs_parser: fix finding the end of a frame
Use the next I/P/B or start code as the end of current frame.

Before the patch, extension start code, user data start code,
sequence end code and so on are treated as the start of next
frame.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-05-20 04:03:44 +08:00
James Almer
4f9799bd88 avcodec/h264_picture: use ff_thread_replace_frame()
Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-18 10:52:30 -03:00
James Almer
3fe74c9017 avcodec/utils: add ff_thread_replace_frame()
Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-18 10:16:03 -03:00
James Almer
63767b79a5 avutil/frame: deprecate palette_has_changed
Not only this is information that relies on the concept of a sequence of
frames, which is completely out of place as a field in AVFrame, but there are
no known or intended uses of this field.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-18 08:45:23 -03:00
Paul B Mahol
c48eff209c avcodec/ccaptions_dec: correct flushing output on EOF
Prevents infinite flushing same last output.
2023-05-18 11:59:34 +02:00
Clement Lecigne
96c30affba avcodec/hevc_ps: add proper bound checks around cm_ref_layer_id in colour_mapping_table.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-17 17:51:36 -03:00
Mark Thompson
8450531059 av1_parse: Don't reject zero-size padding OBUs
Padding OBUs are not required to be nonempty.
2023-05-17 19:38:45 +00:00
Mark Thompson
9c830f4f65 av1_parse: Remove unused getbits instance 2023-05-17 19:38:45 +00:00
Mark Thompson
dce6cf2c36 cbs_av1: Don't reject unknown metadata
Accept it and pass it through unchanged.

The standard requires that decoders ignore unknown metadata, and indeed
this is tested by some of the Argon coverage streams.
2023-05-17 19:38:45 +00:00
Mark Thompson
bee912cb63 cbs_av1: Add tracing headers for metadata types
Make it a little easier to interpret metadata in trace output.
2023-05-17 19:38:45 +00:00
Samuel Mira
416fd1b43b avcodec/mediacodec: Add VP8 encoder
Connected FFmpeg to Mediacodec VP8 encoder.

Signed-off-by: Samuel Mira <samuel.mira@qt.io>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-05-17 19:20:57 +08:00
Samuel Mira
acd37fd566 avcodec/mediacodec: Add AV1 encoder
Connected FFmpeg to Mediacodec AV1 encoder

Signed-off-by: Samuel Mira <samuel.mira@qt.io>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-05-17 19:19:51 +08:00
Hendrik Leppkes
6b2ae90411
avcodec/vdpau_mpeg4: fix order of quant matrix coefficients
The matrix coefficients are stored permutated for the IDCT,
rather then in plain raster order, and need to be un-permutated
for the hardware.
2023-05-15 18:30:54 +02:00
Hendrik Leppkes
308e4ae8e3
avcodec/vdpau_mpeg12: fix order of quant matrix coefficients
The matrix coefficients are stored permutated for the IDCT,
rather then in plain raster order, and need to be un-permutated
for the hardware.
2023-05-15 18:30:49 +02:00