1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-02 03:06:28 +02:00
Commit Graph

48390 Commits

Author SHA1 Message Date
James Almer
68e9d2835f avcodec/cbs_h266: add support for Adaptation parameter set NALU type
Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-06 11:43:13 -03:00
Frank Plowman
4b19690ff4 cbs_h266: add range extension support
example clips:
  * 12b444vvc1_E_Sony_2
  * 12b444Ietsrc_A_Kwai_2
  * 10b444P16_D_Sony_2
  * 12b444Iepp_A_Sharp_2
  * 12b444SPetsrc_B_Kwai_2

Co-authored-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-06 09:05:13 -03:00
James Almer
8995e2f77e avcodec/cbs_h266: add support for Decoding capability information NALU type
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-05 18:18:33 -03:00
James Almer
6cb57bb457 avcodec/cbs_h266: add support for Operating point information NALU type
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-05 18:18:33 -03:00
James Almer
319a6b3ae2 avcodec/cbs_h266: store RowHeightVal and ColWidthVal in the context
Stop overwriting values from the bitstream arrays pps_tile_column_width_minus1
and pps_tile_row_height_minus1.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-05 18:18:33 -03:00
James Almer
ee09f20796 avcodec/cbs_h266: don't infer derived values
The macro is meant for coded values only.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-05 18:18:33 -03:00
Nuo Mi
a357758ec5 vvc.h: Enable 16-bit support for VVC_MAX_POINTS_IN_QP_TABLE
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-05 08:48:56 -03:00
Frank Plowman
a8178be3b3 cbs_h266: expand the bit depth range to 16 bits
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-05 08:46:50 -03:00
Zhao Zhili
bdb4b64f16 avcodec/hevc_parse: check the size of hvcC is at least 23
The code after the check skip 21 bytes and then read two bytes.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-07-04 04:49:48 +08:00
Zhao Zhili
372f71cdc7 avcodec/hevc_parse: restrict configurationVersion to 0 and 1
The standard only defined configurationVersion 1.
configurationVersion 0 is for backward compatibility predates the
standard.

This patch reduces the chance that some malformated streams being
detected as hvcC.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-07-04 04:49:48 +08:00
Devin Heitmueller
695789eacc avcodec/decode: Preserve AFD side data when going from AVPacket to AVFrame
This is needed to ensure that AFD data continues to work when
capturing V210 video with the Decklink libavdevice input.

Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2023-07-02 19:57:45 +02:00
xufuji456
5930d397ef lavc/videotoolboxenc: fix enabling low-latency encode
Use CFDictionarySetValue to enable low-latency encoding mode.
Since the key is a type of "EncoderSpecification", instead of
"CompressionProperty".

Signed-off-by: xufuji456 <839789740@qq.com>
Signed-off-by: Rick Kern <kernrj@gmail.com>
2023-07-02 12:02:51 -04:00
Nuo Mi
3720fa5fec cbs_h266: fix typo for ols_mode_idc == 2
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-02 09:37:16 -03:00
Nuo Mi
8489e317bf cbs_h266: fix sign for pps_xxx_qp_offset_list
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-02 09:36:45 -03:00
James Almer
a77f5019f5 avcodec/cbs_h266: store SubpicIdVal in the context
And use it to derive CurrSubpicIdx

Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-01 19:41:12 -03:00
Andreas Rheinhardt
e7f152a8c2 avcodec/cbs_h266_syntax_template: Avoid shadowing
Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-07-01 17:38:54 +02:00
Andreas Rheinhardt
c732fdfa05 avcodec/cbs_h266_syntax_template: Don't use uninitialized value
Just a typo. Fixes a warning from Clang.

Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-07-01 17:37:55 +02:00
Andreas Rheinhardt
46a5b9e2c0 avcodec/tests/avcodec: Remove unnecessary internal.h inclusion
Forgotten in a688f3c13c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-06-30 17:47:53 +02:00
Andreas Rheinhardt
686156f366 avcodec/hevc_ps: Constify VPS, SPS pointers when parsing PPS
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-06-30 17:47:53 +02:00
James Almer
96d6990517 avcodec/cbs_h266: use VVC_MAX_VPS_COUNT for range checks and array size
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-30 08:42:07 -03:00
James Almer
995976750a avcodec/cbs_h2645: fix parsing and storing Picture Header references in the context
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-30 08:26:38 -03:00
Andreas Rheinhardt
915701939c avcodec/evc_ps: Replace av_malloc+memset by av_mallocz
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-06-30 00:49:11 +02:00
Andreas Rheinhardt
b7158377c9 avcodec/vvc_parser: Mark close function as av_cold
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-06-30 00:48:46 +02:00
Andreas Rheinhardt
0009cbe11d avcodec/vvc_parser: Don't store state unnecessarily
VVCParserContext.au_info is only used once (and in a read-only manner);
but this happens immediately after au_info has been completely
overwritten. Therefore one can just the src structure used to overwrite
au_info directly and remove au_info.

This also means that the whole referencing and unreferncing of au_info
(which duplicates AVBufferRefs CodedBitstreamH266Context and is
therefore of dubious gain) can be removed, as can the AVBufferRef*
contained in PuInfo; this also removes a certain uglyness: Sometimes
these AVBufferRef* were ownership pointers and sometimes not.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-06-30 00:00:57 +02:00
Andreas Rheinhardt
6caf5642c8 avcodec/vvc_parser: Remove unnecessary headers
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-06-29 23:50:29 +02:00
Andreas Rheinhardt
22c47b10b2 avcodec/vvc_parser: Constify parser
The discrepancy between the definition and the declaration
in parsers.c is actually UB.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-06-29 20:22:27 +02:00
Andreas Rheinhardt
e132fae1a5 avcodec/cbs_h266: Remove double ;
Fixes a warning from GCC when in pedantic mode:
"extra semicolon in struct or union specified"
May also fix compilation with MSVC, see
https://fate.ffmpeg.org/report.cgi?time=20230629174305&slot=x86_64-msvc17-windows-native

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-06-29 20:21:24 +02:00
James Almer
86796f1f0e avcodec/version: bump minor after recent additions
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-29 14:12:50 -03:00
Thomas Siedel
54390f4fa7 avcodec: add MP4 to annexb bsf for H266/VVC
Add parser for H.266/VVC MP4 to Annex B byte stream format.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-29 14:12:50 -03:00
Nuo Mi
c7864a9987 avcodec: add Metadata bsf for H266/VVC
Add H.266/VVC metadata bsf.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-29 14:12:50 -03:00
Nuo Mi
b5aefb6e70 avcodec: add bitstream parser for H266/VVC
Add nal parser ff_vvc_parser to parse vvc elementary bitstreams.

Co-authored-by: Thomas Siedel <thomas.ff@spin-digital.com>
Co-authored-by: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-29 14:12:50 -03:00
Nuo Mi
dfc62fd1c6 avcodec/cbs: add cbs implementation for H266/VVC
Add CodedBitstreamContext to parse VPS,SPS,PPS in VVC nal units.
Implement parsing and writing of SPS,PPS,VPS,PH,AUD,SEI and slices.
Add ff_cbs_type_h266 to cbs types tables and AV_CODEC_ID_H266
to cbs codec ids.

Co-authored-by: Thomas Siedel <thomas.ff@spin-digital.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-29 14:12:50 -03:00
James Almer
136e96a8a8 avcodec/extract_extradata: add support for H266/VVC
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-29 14:12:50 -03:00
Nuo Mi
0b8c1f26d3 avcodec/h2645_parse: add support for H266/VVC
Co-authored-by: Thomas Siedel <thomas.ff@spin-digital.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-29 14:12:29 -03:00
Dmitrii Ovchinnikov
f593dc98bf libavcodec/amfenc: add PreAnalysis support
Additional information about the work of preanalysis can be found here:
https://github.com/GPUOpen-LibrariesAndSDKs/AMF/wiki/PreProcessing%20and%20PreAnalysis
2023-06-29 10:49:33 -03:00
Michael Niedermayer
9b6d191a66
avcodec/jpeg2000dec: Check for reduction factor and image offset
This combination is not working (it writes out of array)

Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-06-27 22:36:44 +02:00
Lynne
c39e861a3d
vulkan_h264: check if slices_buf exists on end_frame
The issue is that while decode_slice is guaranteed to never get
called without start_frame, end_frame is not. Moreover, it is
not guaranteed it won't be called twice.

On a badly-broken sample, this is what happens, which leads to
a segfault, as vp->slices_buf doesn't exist, as it has been handed
off for decoding already and isn't owned by the frame.

Return an error as it's indicative that it's a corrupt stream rather
than just missing any slices.

Prevents a segfault.
2023-06-25 03:11:38 +02:00
James Almer
10f1bbfe11 avcodec/j2kenc: use uint64_t type for the lambda value
Should fix integer overflows, and improve encoding results.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-24 14:39:04 -03:00
James Almer
35af1695a9 avcodec/aac_ac3_parser: add preprocessor checks for codec specific code
Should fix ticket #10421.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-24 14:38:29 -03:00
James Almer
a9d41ab890 avcodec/evc_frame_merge: remove an av_packet_copy_props() call
And only fill out if no failures can happen, fixing potential leaks.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-23 11:06:35 -03:00
James Almer
ffe4ec5c84 avcodec/evc_ps: fix allowed range for pps_pic_parameter_set_id
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-23 09:39:14 -03:00
James Almer
7347b44224 avcodec/evc_ps: use unsigned types in structs where corresponds
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-23 08:37:23 -03:00
James Almer
5b966be5b8 avcodec/evc_parse: use unsigned types in structs where corresponds
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-23 08:37:23 -03:00
James Almer
b1b45ac9d4 avcodec/evc_frame_merge: ensure the assembled buffer fits in an AVPacket
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-23 08:37:23 -03:00
caleb
043a9d09cb
avcodec/jpeg2000htdec: Check for invalid magref length.
Fixes: shift exponent -8 is negative
Fixes: 58328/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-6007789196804096

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-06-23 02:06:45 +02:00
Michael Niedermayer
a4bf559683
avcodec/utils: fix 2 integer overflows in get_audio_frame_duration()
Fixes: signed integer overflow: 256 * 668003712 cannot be represented in type 'int'
Fixes: 59819/clusterfuzz-testcase-minimized-ffmpeg_dem_MATROSKA_fuzzer-4674636538052608

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-06-23 02:06:45 +02:00
James Almer
9834660601 avcodec/evc_frame_merge: copy input packet props to output
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-22 16:08:14 -03:00
James Almer
daf61a706a avcodec/evc_frame_merge: reindent after previous commit
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-22 16:08:14 -03:00
James Almer
e6359b0cc1 avcodec/evc_frame_merge: properly support packets with more than one NALU
Parse through all NALUs in a packet, pull new ones when a complete AU could not
be assembled, or keep them around if an AU was assembled while data remained in
them.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-22 16:08:14 -03:00
Ricardo Monteiro
99dfdb45a8 avcodec/nvenc: let preset decide default gop size
Default GOP size is now set by preset and tuning info. This GOP size is only overwriten if -g value is provided.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2023-06-22 19:33:09 +02:00