Re: [FFmpeg-devel] [PATCH 6/6] lavf/tls_mbedtls: add workaround for TLSv1.3 vs. verify=0

2024-06-11 Thread Anton Khirnov
ithub.com/Mbed-TLS/mbedtls/issues/7075 > Signed-off-by: sfan5 > --- Would it not be simpler to simply set authmode to MBEDTLS_SSL_VERIFY_OPTIONAL unconditionally, then just disregard the verification result? -- Anton Khirnov ___ ffmpeg-devel m

Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg_mux_init: Fix leak when using non-encoding option

2024-06-11 Thread Anton Khirnov
_log(mux, AV_LOG_ERROR, "Codec AVOption %s (%s) is not an " > "encoding option.\n", e->key, option->help ? option->help > : ""); > + av_dict_free(_opts); > return AVERROR(EINVAL); LGTM -- Anton Khirnov ___

Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg_mux_init: Return error upon error

2024-06-10 Thread Anton Khirnov
return AVERROR(ENOMEM); Looks good. Would look even better with the size increment outside of the av_realloc_f() call. -- Anton Khirnov ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 23/39] lavc/hevcdec: drop redundant HEVCContext.threads_{type, number}

2024-06-08 Thread Anton Khirnov
Quoting Christophe Gisquet (2024-06-08 09:08:01) > Le ven. 7 juin 2024, 15:05, Anton Khirnov a écrit : > > > They are useless duplicates of corresponding AVCodecContext fields. > > > > FYI, the intent of one field was to be a bit field to simultaneously > indicate/

Re: [FFmpeg-devel] [PATCH 22/39] lavc/hevc/cabac: do not infer WPP use based on HEVCContext.threads_number

2024-06-08 Thread Anton Khirnov
Quoting Christophe Gisquet (2024-06-08 09:02:04) > Le ven. 7 juin 2024, 15:07, Anton Khirnov a écrit : > > > if (pps->tiles_enabled_flag && > > pps->tile_id[ctb_addr_ts] != pps->tile_id[ctb_addr_ts - 1]) { > > int re

[FFmpeg-devel] [PATCH 39/39] lavc/hevcdec: constify source frame in hevc_ref_frame()

2024-06-07 Thread Anton Khirnov
--- libavcodec/hevc/hevcdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index 5fc55d5de9..88f2bcecad 100644 --- a/libavcodec/hevc/hevcdec.c +++ b/libavcodec/hevc/hevcdec.c @@ -3449,7 +3449,7 @@ static int

[FFmpeg-devel] [PATCH 37/39] lavc/hevcdec: move some frame-end code to hevc_frame_end()

2024-06-07 Thread Anton Khirnov
Specifically, calling hwaccel end_frame, verifying frame checksum, and printing the frame-was-decoded message. --- libavcodec/hevc/hevcdec.c | 187 +++--- libavcodec/hevc/hevcdec.h | 1 - 2 files changed, 91 insertions(+), 97 deletions(-) diff --git

[FFmpeg-devel] [PATCH 38/39] lavc/hevcdec: do not unref current frame on frame_end() failure

2024-06-07 Thread Anton Khirnov
It's a race with frame threading. --- libavcodec/hevc/hevcdec.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index a8c2172674..5fc55d5de9 100644 --- a/libavcodec/hevc/hevcdec.c +++ b/libavcodec/hevc/hevcdec.c @@

[FFmpeg-devel] [PATCH 32/39] lavc/hevcdec: move sequence increment/IDR handling to hevc_frame_start()

2024-06-07 Thread Anton Khirnov
>From hls_slice_header(). It is only done once per frame, so that is a more appropriate place for this code. --- libavcodec/hevc/hevcdec.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index

[FFmpeg-devel] [PATCH 21/39] lavc/hevcdec: output RASL frames based on the value of no_rasl_output_flag

2024-06-07 Thread Anton Khirnov
Instead of an ad-hoc scheme. Also, combine skipping RASL frames with skip_frame handling - current code seems flawed as it only executes for the first slice of a RASL frame and unnecessarily unsets is_decoded, which should not be set at this point anyway.. Some RASL frames in fate-hevc-afd-tc-sei

[FFmpeg-devel] [PATCH 13/39] lavc/hevcdec: drop an always-zero variable

2024-06-07 Thread Anton Khirnov
--- libavcodec/hevc/hevcdec.c | 9 ++--- libavcodec/hevc/hevcdec.h | 1 - 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index 6dda923df5..d599373c9d 100644 --- a/libavcodec/hevc/hevcdec.c +++ b/libavcodec/hevc/hevcdec.c @@

[FFmpeg-devel] [PATCH 08/39] lavc/hevc/filter: stop accessing parameter sets through HEVCParamSets

2024-06-07 Thread Anton Khirnov
Instead, accept PPS as a function argument and retrieve SPS through it. Makes the code shorter and significantly reduces diff in future commits. --- libavcodec/hevc/filter.c | 311 -- libavcodec/hevc/hevcdec.c | 20 +-- libavcodec/hevc/hevcdec.h | 14 +- 3

[FFmpeg-devel] [PATCH 05/39] lavc/hevc_ps: make SPS hold a reference to its VPS

2024-06-07 Thread Anton Khirnov
SPS and its dependent PPSes depend on, and are parsed for, specific VPS data. This will be useful in following commits. --- libavcodec/hevc/hevcdec.c | 5 ++--- libavcodec/hevc/parser.c | 2 +- libavcodec/hevc/ps.c | 13 + libavcodec/hevc/ps.h | 2 ++ 4 files changed,

[FFmpeg-devel] [PATCH 06/39] lavc/hevc/parser: stop using HEVCParamSets.[psv]ps

2024-06-07 Thread Anton Khirnov
The parser does not need to preserve these between frames. --- libavcodec/hevc/parser.c | 55 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/libavcodec/hevc/parser.c b/libavcodec/hevc/parser.c index 49f7bccdfa..f4e6e3c36d 100644 ---

[FFmpeg-devel] [PATCH 09/39] lavc/hevc/cabac: stop accessing parameter sets through HEVCParamSets

2024-06-07 Thread Anton Khirnov
Instead, accept PPS/SPS as function arguments. Makes the code shorter and significantly reduces diff in future commits. --- libavcodec/hevc/cabac.c | 145 +++--- libavcodec/hevc/hevcdec.c | 31 libavcodec/hevc/hevcdec.h | 22 +++--- 3 files changed,

[FFmpeg-devel] [PATCH 34/39] lavc/hevcdec: move the check for multiple frames in a packet

2024-06-07 Thread Anton Khirnov
Do not do it in hls_slice_header(), which is the wrong place for it. Avoids special magic return value of 1 in that function. The comment mentioning potential corrupted state is no longer relevant, as hls_slice_header() modifies no state beyond SliceHeader, which will only get used for a valid

[FFmpeg-devel] [PATCH 31/39] lavc/hevcdec: set active PPS/SPS in hevc_frame_start()

2024-06-07 Thread Anton Khirnov
Not in hls_slice_header(), as it should only be done once per frame. --- libavcodec/hevc/hevcdec.c | 52 --- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index 804cceac3e..9abae3260d

[FFmpeg-devel] [PATCH 33/39] lavc/hevcdec: move setting slice_initialized out of hls_slice_header()

2024-06-07 Thread Anton Khirnov
hls_slice_header() no longer modifies anything in HEVCContext besides SliceHeader. --- libavcodec/hevc/hevcdec.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index b13e3e06a3..2809e1e61d 100644 ---

[FFmpeg-devel] [PATCH 30/39] lavc/hevcdec: move constructing slice RPL to decode_slice_data()

2024-06-07 Thread Anton Khirnov
--- libavcodec/hevc/hevcdec.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index c148244361..804cceac3e 100644 --- a/libavcodec/hevc/hevcdec.c +++ b/libavcodec/hevc/hevcdec.c @@ -665,11 +665,9

[FFmpeg-devel] [PATCH 36/39] lavc/hevcdec: factor decoding a slice NALU out of decode_nal_unit()

2024-06-07 Thread Anton Khirnov
--- libavcodec/hevc/hevcdec.c | 97 +-- 1 file changed, 52 insertions(+), 45 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index b9aea45edb..7263b80a24 100644 --- a/libavcodec/hevc/hevcdec.c +++ b/libavcodec/hevc/hevcdec.c @@

[FFmpeg-devel] [PATCH 28/39] lavc/hevcdec: move calling hwaccel start_frame to hevc_frame_start()

2024-06-07 Thread Anton Khirnov
>From decode_nal_unit(), as that is a more appropriate place for it. --- libavcodec/hevc/hevcdec.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index cda52e05ef..0bf68ea45c 100644 ---

[FFmpeg-devel] [PATCH 25/39] lavc/hevcdec: move a slice segment sanity check to hls_slice_header()

2024-06-07 Thread Anton Khirnov
Combine it with an existing similar check. --- libavcodec/hevc/hevcdec.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index df6d1565bc..9c1d879953 100644 --- a/libavcodec/hevc/hevcdec.c +++

[FFmpeg-devel] [PATCH 29/39] lavc/hevcdec: move calling hwaccel decode_slice to decode_slice_data()

2024-06-07 Thread Anton Khirnov
>From decode_nal_unit(), as that is a more appropriate place for it. --- libavcodec/hevc/hevcdec.c | 38 +- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index 0bf68ea45c..c148244361 100644

[FFmpeg-devel] [PATCH 22/39] lavc/hevc/cabac: do not infer WPP use based on HEVCContext.threads_number

2024-06-07 Thread Anton Khirnov
Pass this information explicitly instead. --- libavcodec/hevc/cabac.c | 7 --- libavcodec/hevc/hevcdec.c | 4 ++-- libavcodec/hevc/hevcdec.h | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/libavcodec/hevc/cabac.c b/libavcodec/hevc/cabac.c index 8708efc248..39ca7c0135

[FFmpeg-devel] [PATCH 24/39] lavc/hevcdec: store slice header POC in SliceHeader

2024-06-07 Thread Anton Khirnov
Rather than decoding directly into HEVCContext.poc. This is a step towards constifying HEVCContext in hls_slice_header(). --- libavcodec/hevc/hevcdec.c | 13 +++-- libavcodec/hevc/hevcdec.h | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c

[FFmpeg-devel] [PATCH 26/39] lavc/hevcdec: move slice decoding dispatch to its own function

2024-06-07 Thread Anton Khirnov
Also move there a sanity check from hls_decode_entry() that should also be performed when WPP is active (note that the check is not moved to hls_slice_header() because it requires the HEVCContext.tab_slice_address to be set up). --- libavcodec/hevc/hevcdec.c | 36

[FFmpeg-devel] [PATCH 16/39] lavc/hevcdec: do not pass HEVCContext to decode_lt_rps()

2024-06-07 Thread Anton Khirnov
Pass the two numbers needed from it explicitly. Makes it clear that HEVCContext is not modified by this function. --- libavcodec/hevc/hevcdec.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index

[FFmpeg-devel] [PATCH 12/39] lavc/hevcdec: move active PPS from HEVCParamSets to HEVCContext

2024-06-07 Thread Anton Khirnov
"Currently active PPS" is a property of the decoding process, not of the list of available parameter sets. --- libavcodec/dxva2_hevc.c | 8 libavcodec/hevc/hevcdec.c | 19 --- libavcodec/hevc/hevcdec.h | 1 + libavcodec/hevc/ps.c | 12 ++--

[FFmpeg-devel] [PATCH 20/39] lavc/hevcdec: only set no_rasl_output_flag for IRAP frames

2024-06-07 Thread Anton Khirnov
Its meaning is only specified for IRAP frames. As it's currently never used otherwise, this should not change decoder behaviour, but will be useful in future commits. --- libavcodec/hevc/hevcdec.c | 4 +++- libavcodec/hevc/hevcdec.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff

[FFmpeg-devel] [PATCH 35/39] lavc/hevcdec: drop a redundant multiple-frame-per-packet check

2024-06-07 Thread Anton Khirnov
--- libavcodec/hevc/hevcdec.c | 4 libavcodec/hevc/hevcdec.h | 1 - 2 files changed, 5 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index a241e25196..b9aea45edb 100644 --- a/libavcodec/hevc/hevcdec.c +++ b/libavcodec/hevc/hevcdec.c @@ -3143,7 +3143,6 @@

[FFmpeg-devel] [PATCH 27/39] lavc/hevcdec: move per-slice local_ctx setup out of hls_slice_header()

2024-06-07 Thread Anton Khirnov
Into decode_slice_data(). This is a step towards constifying HEVCContext in hls_slice_header(). --- libavcodec/hevc/hevcdec.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index bbcaa350c7..cda52e05ef

[FFmpeg-devel] [PATCH 19/39] lavc/hevcdec: do not pass HEVCContext to ff_hevc_frame_nb_refs()

2024-06-07 Thread Anton Khirnov
Pass the only things required from it - slice header and PPS - explicitly. Will be useful in the following commits to avoid mofiying HEVCContext in hls_slice_header(). --- libavcodec/hevc/hevcdec.c | 2 +- libavcodec/hevc/hevcdec.h | 2 +- libavcodec/hevc/refs.c| 8

[FFmpeg-devel] [PATCH 17/39] lavc/hevcdec: move pocTid0 computation to hevc_frame_start()

2024-06-07 Thread Anton Khirnov
It is only done once per frame. Also, rename the variable to poc_tid0 to be consistent with our naming conventions. --- libavcodec/hevc/hevcdec.c | 26 +- libavcodec/hevc/hevcdec.h | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git

[FFmpeg-devel] [PATCH 18/39] lavc/hevcdec: only call export_stream_params_from_sei() once per frame

2024-06-07 Thread Anton Khirnov
Not once per each slice header, as it makes no sense and may cause races with frame threading. --- libavcodec/hevc/hevcdec.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index dd3c188418..bf6e93ba1b 100644 ---

[FFmpeg-devel] [PATCH 14/39] lavc/hevcdec: only ignore INVALIDDATA in decode_nal_unit()

2024-06-07 Thread Anton Khirnov
All other errors should cause a failure, regardless of the value of err_recognition. Also, print a warning message when skipping invalid NAL units. --- libavcodec/hevc/hevcdec.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c

[FFmpeg-devel] [PATCH 11/39] lavc/hevcdec: stop accessing parameter sets through HEVCParamSets

2024-06-07 Thread Anton Khirnov
Instead, accept PPS/SPS as function arguments. Makes the code shorter and significantly reduces diff in future commits. --- libavcodec/hevc/hevcdec.c | 876 -- 1 file changed, 469 insertions(+), 407 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c

[FFmpeg-devel] [PATCH 23/39] lavc/hevcdec: drop redundant HEVCContext.threads_{type, number}

2024-06-07 Thread Anton Khirnov
They are useless duplicates of corresponding AVCodecContext fields. --- libavcodec/hevc/filter.c | 6 +++--- libavcodec/hevc/hevcdec.c | 36 +--- libavcodec/hevc/hevcdec.h | 3 --- libavcodec/hevc/mvs.c | 4 ++-- libavcodec/hevc/refs.c| 2 +- 5 files

[FFmpeg-devel] [PATCH 10/39] lavc/hevc/pred: stop accessing parameter sets through HEVCParamSets

2024-06-07 Thread Anton Khirnov
Instead, accept PPS/SPS as function arguments. Makes the code shorter and significantly reduces diff in future commits. --- libavcodec/hevc/hevcdec.c | 26 +-- libavcodec/hevc/pred.h | 4 +- libavcodec/hevc/pred_template.c | 74 libavcodec/mips/hevcpred_mips.h | 4

[FFmpeg-devel] [PATCH 15/39] lavc/hevcdec: pass SliceHeader explicitly to pred_weight_table()

2024-06-07 Thread Anton Khirnov
And replace the HEVCContext* parameter by void *logctx. Makes it clear that only SliceHeader is modified by this function. --- libavcodec/hevc/hevcdec.c | 75 --- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c

[FFmpeg-devel] [PATCH 07/39] lavc/hevc/mvs: stop accessing parameter sets through HEVCParamSets

2024-06-07 Thread Anton Khirnov
Instead, accept PPS as a function argument and retrieve SPS through it. Makes the code shorter and significantly reduces diff in future commits. --- libavcodec/hevc/hevcdec.c | 28 + libavcodec/hevc/hevcdec.h | 8 ++- libavcodec/hevc/mvs.c | 126

[FFmpeg-devel] [PATCH 03/39] lavc/hevcdec: drop a redundant assignment in hevc_decode_frame()

2024-06-07 Thread Anton Khirnov
The exact same code is executed at the beginning of decode_nal_units() --- libavcodec/hevc/hevcdec.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index 43cbc45062..46db7923fe 100644 --- a/libavcodec/hevc/hevcdec.c +++

[FFmpeg-devel] [PATCH 02/39] lavc/hevcdec: simplify condition

2024-06-07 Thread Anton Khirnov
--- libavcodec/hevc/hevcdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index d317c1471a..43cbc45062 100644 --- a/libavcodec/hevc/hevcdec.c +++ b/libavcodec/hevc/hevcdec.c @@ -3115,7 +3115,7 @@ static int

[FFmpeg-devel] [PATCH 04/39] lavc/hevc_ps: make PPS hold a reference to its SPS

2024-06-07 Thread Anton Khirnov
PPS depends on, and is parsed for, specific SPS data. This will be useful in following commits. --- libavcodec/hevc/hevcdec.c | 4 ++-- libavcodec/hevc/parser.c | 8 ++-- libavcodec/hevc/ps.c | 4 libavcodec/hevc/ps.h | 2 ++ 4 files changed, 10 insertions(+), 8 deletions(-)

[FFmpeg-devel] [PATCH 01/39] lavc/hevcdec: do not free SliceHeader arrays in pic_arrays_free()

2024-06-07 Thread Anton Khirnov
SliceHeader.{entry_point_offset,size,offset} are not derived from frame size and do not need to be freed here. --- libavcodec/hevc/hevcdec.c | 4 1 file changed, 4 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index 4e0df4d033..d317c1471a 100644 ---

Re: [FFmpeg-devel] [PATCH] avfilter: add sdlvsink for video display

2024-06-07 Thread Anton Khirnov
or buts > > here; libavfilter simply can't require that from the calling application or > > upper-layer framework and therefore it also can't warrant it to SDL. > > We can require anything from an API that we are able to change and extend > Of course we can decide not to allow

Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg_demux: gracefully ignore mismatching channel layouts for -channel_layout option

2024-06-05 Thread Anton Khirnov
ticket #11016. I'm ambivalent about this. On one hand it probably doesn't hurt, for now at least, on the other it seems quite ad-hoc. Previously it worked this way mostly by accident, whereas if we now restore this behaviour deliberately we'll be committing to supporting it for the foreseea

Re: [FFmpeg-devel] [PATCH v6 1/4] doc: Explain what "context" means

2024-06-05 Thread Anton Khirnov
le changed, 430 insertions(+) > create mode 100644 doc/context.md 430 lines to say "context is a struct storing an object's state"? -- Anton Khirnov ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-

Re: [FFmpeg-devel] [PATCH v6 3/4] all: Link to "context" from all public contexts with documentation

2024-06-05 Thread Anton Khirnov
ibavutil/hwcontext_vaapi.h | 6 ++ > libavutil/hwcontext_vdpau.h | 3 +++ > libavutil/hwcontext_vulkan.h | 6 ++ > libavutil/lfg.h | 3 +++ > 24 files changed, 98 insertions(+), 1 deletion(-) IMO this is pointless churn. -- Anton Khirnov __

Re: [FFmpeg-devel] New CC member: Steven Liu

2024-06-05 Thread Anton Khirnov
Quoting Ronald S. Bultje (2024-06-05 01:32:12) > Steven Liu as next runner-up We are using a proportional system, which does not work this way. -- Anton Khirnov ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listi

Re: [FFmpeg-devel] [PATCH v4 1/1] avcodec: add external enc libvvenc for H266/VVC

2024-06-04 Thread Anton Khirnov
ss stats", OFFSET(stats), > AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, VE}, These option names conflict with ffmpeg CLI options. -- Anton Khirnov ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-d

Re: [FFmpeg-devel] FFmpeg 7.0 blocking issues

2024-06-04 Thread Anton Khirnov
to migrate to a new API every year. IME smaller and more frequent changes are both easier to manage and have a lower risk of bugs than a massive all-breaking API migration once in five years. -- Anton Khirnov ___ ffmpeg-devel mailing list ffmpeg-devel

Re: [FFmpeg-devel] [PATCH 09/11] lavc/hevc*: move to hevc/ subdir

2024-06-02 Thread Anton Khirnov
leave this for later. -- Anton Khirnov ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 05/11] lavc/hevcdec: drop HEVCContext.HEVClc

2024-05-31 Thread Anton Khirnov
It is merely a pointer to local_ctx[0], which we can just as well use directly. --- libavcodec/hevcdec.c | 24 ++-- libavcodec/hevcdec.h | 2 -- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index

[FFmpeg-devel] [PATCH 06/11] lavc/hevcdec: rename HEVCContext.ref to cur_frame

2024-05-31 Thread Anton Khirnov
Since it stores a pointer to the current frame. --- libavcodec/dxva2_hevc.c| 12 +++--- libavcodec/hevc_filter.c | 34 - libavcodec/hevc_mvs.c | 20 +- libavcodec/hevc_refs.c | 18 - libavcodec/hevcdec.c | 68

[FFmpeg-devel] [PATCH 11/11] lavc/hevcdec: drop unused HEVCContext.width/height

2024-05-31 Thread Anton Khirnov
--- libavcodec/hevc/hevcdec.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/libavcodec/hevc/hevcdec.h b/libavcodec/hevc/hevcdec.h index 8208268460..33ad4ac0aa 100644 --- a/libavcodec/hevc/hevcdec.h +++ b/libavcodec/hevc/hevcdec.h @@ -456,9 +456,6 @@ typedef struct HEVCContext {

[FFmpeg-devel] [PATCH 09/11] lavc/hevc*: move to hevc/ subdir

2024-05-31 Thread Anton Khirnov
--- libavcodec/Makefile | 12 ++- libavcodec/aarch64/hevcdsp_init_aarch64.c | 2 +- libavcodec/arm/hevcdsp_arm.h | 2 +- libavcodec/arm/hevcdsp_init_arm.c | 2 +- libavcodec/arm/hevcdsp_init_neon.c| 2 +-

[FFmpeg-devel] [PATCH 10/11] lavc/hevcdec: deduplicate calling hwaccel decode_params()

2024-05-31 Thread Anton Khirnov
--- libavcodec/hevc/hevcdec.c | 36 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index 4a07fa6612..4e0df4d033 100644 --- a/libavcodec/hevc/hevcdec.c +++ b/libavcodec/hevc/hevcdec.c @@

[FFmpeg-devel] [PATCH 08/11] lavc/hevcdec: drop HEVCContext.frame

2024-05-31 Thread Anton Khirnov
It is merely a redundant pointer to cur_frame->f --- libavcodec/hevc_cabac.c| 4 +-- libavcodec/hevc_filter.c | 39 +++-- libavcodec/hevc_refs.c | 3 +- libavcodec/hevcdec.c | 53 +- libavcodec/hevcdec.h

[FFmpeg-devel] [PATCH 07/11] lavc/hevcdec: rename HEVCFrame.frame to just f

2024-05-31 Thread Anton Khirnov
This is shorter, loses no information, and is consistent with other similar structs. --- libavcodec/dxva2_hevc.c | 8 +++ libavcodec/hevc_refs.c | 34 +-- libavcodec/hevcdec.c | 50 libavcodec/hevcdec.h | 2 +-

[FFmpeg-devel] [PATCH 02/11] lavc/hevcdec: drop a useless condition

2024-05-31 Thread Anton Khirnov
hls_slice_data_wpp() is only called when num_entry_point_offsets>0 --- libavcodec/hevcdec.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index ad2cbd7ece..d3715f9de7 100644 --- a/libavcodec/hevcdec.c +++

[FFmpeg-devel] [PATCH 03/11] lavc/hevcdec: include first row in SliceHeader.offset/size

2024-05-31 Thread Anton Khirnov
Will be useful in the following commit. --- libavcodec/hevcdec.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index d3715f9de7..42fd33961b 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -975,8

[FFmpeg-devel] [PATCH 04/11] lavc/hevcdec: drop HEVCLocalContext.gb

2024-05-31 Thread Anton Khirnov
In all HEVCLocalContext instances except the first one, the bitreader is never used for actually reading bits, but merely for passing the buffer to ff_init_cabac_decoder(), which is better done directly. The instance that actually is used for bitreading gets moved to stack in decode_nal_unit(),

[FFmpeg-devel] [PATCH 01/11] lavc/hevcdec: move handling of byte alignment at the end of slice header

2024-05-31 Thread Anton Khirnov
Do it in hls_slice_header() rather than cabac_init_decoder() - the former is a more logical place as according the spec the byte alignment is a part of the slice header, not slice data. Avoids a second instance of alignment handling in vaapi_hevc. Also, check that alignment_bit_equal_to_one is,

Re: [FFmpeg-devel] [PATCH] avformat/framecrcenc: compute the checksum for side data

2024-05-31 Thread Anton Khirnov
Quoting James Almer (2024-05-27 16:11:13) > On 5/27/2024 5:15 AM, Anton Khirnov wrote: > > Quoting Michael Niedermayer (2024-04-27 02:36:23) > >> This allows detecting issues in side data related code, same as what > >> framecrc does for before already for packet data i

Re: [FFmpeg-devel] [PATCH] avformat/framecrcenc: compute the checksum for side data

2024-05-31 Thread Anton Khirnov
Quoting Michael Niedermayer (2024-05-27 20:11:05) > If you block this solution without providing another solution > then i will bring this to the technical committee, to seek its guidance > on the way forward. The solution is to use a tool appropriate for the purpose, like ffprobe.

[FFmpeg-devel] [PATCH v2 09-10] lavc/hevc_ps: reduce the size of ShortTermRPS.used

2024-05-29 Thread Anton Khirnov
It is currently an array of 32 uint8_t, each storing a single flag. A single uint32_t is sufficient. Reduces sizeof(HEVCSPS) by 1792 bytes. --- libavcodec/hevc_ps.c | 33 +++-- libavcodec/hevc_ps.h | 2 +- libavcodec/hevc_refs.c | 6 +++---

[FFmpeg-devel] [PATCH v2 03/10] lavc/hevcdec: allocate local_ctx as array of structs rather than pointers

2024-05-28 Thread Anton Khirnov
It is more efficient and easier to manage. --- libavcodec/hevcdec.c | 57 +--- libavcodec/hevcdec.h | 6 - 2 files changed, 37 insertions(+), 26 deletions(-) diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index e84f45e3f8..88a481c043 100644

Re: [FFmpeg-devel] [PATCH v3 01/10] channel_layout: add new channel positions supported by xHE-AAC

2024-05-27 Thread Anton Khirnov
Quoting Lynne via ffmpeg-devel (2024-05-27 10:54:40) > On 27/05/2024 10:40, Anton Khirnov wrote: > > Quoting Lynne via ffmpeg-devel (2024-05-26 23:42:41) > >> ...its an enum entry. Do you want a design document and a proposal? > >> You could talk to the person who did

Re: [FFmpeg-devel] [PATCH v3 01/10] channel_layout: add new channel positions supported by xHE-AAC

2024-05-27 Thread Anton Khirnov
s of developers pushing code immediately upon seeing an LGTM, without giving other people the opportunity to look at it. -- Anton Khirnov ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscr

Re: [FFmpeg-devel] [PATCH] avformat/framecrcenc: compute the checksum for side data

2024-05-27 Thread Anton Khirnov
a fundamentally wrong thing to do. -- Anton Khirnov ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v2 1/5] fftools/ffmpeg_demux: honor -ch_layout options for overriding input stream channel layout

2024-05-27 Thread Anton Khirnov
--- > 1 file changed, 24 insertions(+), 3 deletions(-) Looks ok -- Anton Khirnov ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 1/5] fftools/ffmpeg_demux: also set -ch_layout avcodec option for -ch_layout CLI param

2024-05-27 Thread Anton Khirnov
Quoting Anton Khirnov (2024-05-27 09:51:49) > I don't like modifying OptionsContext in its consumers (it's const for a > reason), and it's probably not even necessary - if the semantics of the > option is "override demuxer-reported channel layout", then you can just > overrid

Re: [FFmpeg-devel] [PATCH 1/5] fftools/ffmpeg_demux: also set -ch_layout avcodec option for -ch_layout CLI param

2024-05-27 Thread Anton Khirnov
val, AV_DICT_DONT_STRDUP_KEY); I don't like modifying OptionsContext in its consumers (it's const for a reason), and it's probably not even necessary - if the semantics of the option is "override demuxer-reported channel layout", then you can just override the demuxer-report

Re: [FFmpeg-devel] [PATCH v2 1/5] fftools/ffmpeg_demux: honor -ch_layout options for overriding input stream channel layout

2024-05-25 Thread Anton Khirnov
> specified. > > > > Fixes ticket #11016. > > Will apply the series. Could you please wait a few days? I'm just freshly back from a vacation and didn't have time to look at this in detail yet. -- Anton Khirnov ___ ffmpeg-devel

Re: [FFmpeg-devel] Flushing while decoding , but need already decoded frames

2024-05-24 Thread Anton Khirnov
Quoting Andrey Turkin (2024-05-24 13:39:15) > Have to say, this issue has been a long grievance of mine. There is no > reason to delay frames when the decoder is set up to ignore B frames > as there is no reordering to be done; This only holds for pre-h264 codecs. -- Anto

Re: [FFmpeg-devel] [PATCH 10/10] lavc/hevc_ps: compactify ShortTermRPS

2024-05-24 Thread Anton Khirnov
unsigned int delta_rps_sign:1; /* 136:16 4 */ unsigned int rps_predict:1;/* 136:17 4 */ unsigned int use_delta:1; /* 136:18 4 */ /* size: 140, cachelines: 3, members: 10 */ /* bit_padding: 13 bits

Re: [FFmpeg-devel] [PATCH 09/10] lavc/hevc_ps: reduce the size of ShortTermRPS.used

2024-05-24 Thread Anton Khirnov
Quoting James Almer (2024-04-10 15:42:51) > > > On 4/10/2024 10:31 AM, Anton Khirnov wrote: > > diff --git a/libavcodec/vulkan_hevc.c b/libavcodec/vulkan_hevc.c > > index 5d7c6b1b64..c2b65fc201 100644 > > --- a/libavcodec/vulkan_hevc.c > > +++ b/libavcodec/vul

Re: [FFmpeg-devel] [PATCH 06/10] lavc/hevc_ps/HEVCSPS: change flags into size-1 bitfields

2024-05-24 Thread Anton Khirnov
Quoting Andreas Rheinhardt (2024-04-11 13:55:05) > Anton Khirnov: > > Reduces sizeof(HEVCSPS) by 96 bytes. > > > > Also improve flag names: drop redundant suffixes and prefixes, and > > consistently use disabled/enabled. > > --- > > libavcodec/dxva2_hevc.

Re: [FFmpeg-devel] [PATCH 03/10] lavc/hevcdec: allocate local_ctx as array of structs rather than pointers

2024-05-24 Thread Anton Khirnov
Quoting Andreas Rheinhardt (2024-04-17 11:29:18) > Anton Khirnov: > > It is more efficient and easier to manage. > > --- > > Allocating structures used by slice contexts jointly has the potential > downside of false sharing if the structures are not sufficiently > a

[FFmpeg-devel] [PATCH 2/4] fftools/ffmpeg: rewrite checking whether codec AVOptions have been used

2024-05-23 Thread Anton Khirnov
Share the code between encoding and decoding. Instead of checking every stream's options dictionary (which is also used for other purposes), track all used options in a dedicated dictionary. --- fftools/cmdutils.c| 17 fftools/cmdutils.h| 4 ++- fftools/ffmpeg.c

[FFmpeg-devel] [PATCH 4/4] fftools/ffmpeg_mux_init: make encoder_opts local to ost_add()

2024-05-23 Thread Anton Khirnov
It is no longer needed after this function returns. --- fftools/ffmpeg.h | 2 -- fftools/ffmpeg_mux.c | 1 - fftools/ffmpeg_mux_init.c | 71 ++- 3 files changed, 40 insertions(+), 34 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h

[FFmpeg-devel] [PATCH 3/4] fftools/ffmpeg_mux_init: apply encoder options manually

2024-05-23 Thread Anton Khirnov
Do not pass an options dictionary to the avcodec_open2() in enc_open(). This is cleaner and more robust, as previously various bits of code would try to interpret the contents of the options dictionary, with varying degrees of correctness. Now they can just access the encoder AVCodecContext

[FFmpeg-devel] [PATCH 1/4] lavc/qsvenc: rename the skip_frame private option to qsv_skip_frame

2024-05-23 Thread Anton Khirnov
It conflicts with the AVCodecContext option of the same name. --- libavcodec/qsvenc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h index e3eb083746..d69dd19049 100644 --- a/libavcodec/qsvenc.h +++ b/libavcodec/qsvenc.h @@ -139,7

Re: [FFmpeg-devel] [PATCH] fftools/ffprobe: Avoid overflow when calculating DAR

2024-05-23 Thread Anton Khirnov
par->width * sar.num, > - par->height * sar.den, > + (int64_t) par->width * sar.num, > + (int64_t) par->height * sar.den, Aren't we supposed to avoid assumptions that int is always strictly smaller than 64bit? -- Ant

Re: [FFmpeg-devel] [PATCH] avfilter/src_movie: Remove align dimension to fix crash

2024-05-23 Thread Anton Khirnov
d by > decoders. As I remember, the original intent behind lavfi get_buffer functions was: 1) Allow a downstream filter like pad to allocate a larger frame in order to avoid copying. 2) Allow direct rendering into caller-provided buffers (currently not supported).

Re: [FFmpeg-devel] [RFC PATCH] avfilter/video: Protect frame_pool from multi-threads access

2024-05-23 Thread Anton Khirnov
ce threading and slice threads should not allocate frames. In your example it seems to happen because of frame threading in the movie source, but that should ideally be handled inside that filter. -- Anton Khirnov ___ ffmpeg-devel mailing list ffmpeg-de

Re: [FFmpeg-devel] [PATCH 1/2] avutil/channel_layout: add a helper function to get the ambisonic order of a layout

2024-05-23 Thread Anton Khirnov
get_ambisonic_order(const AVChannelLayout > *channel_layout) IMO the _get_ in the name is just making it unnecessarily longer. -- Anton Khirnov ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To un

Re: [FFmpeg-devel] [PATCH 0/5] replace scale2ref by scale=rw:rh

2024-05-23 Thread Anton Khirnov
o work, next. While I agree that it would be nice, using duplicate link labels currently does not break, and I've seen multiple people using those. So we'll probably need to deprecate this behaviour first. -- Anton Khirnov ___ ffmpeg-devel mailing list

Re: [FFmpeg-devel] [PATCH v2] lavu/opt: Clarify that AVOptions is not indended for general use

2024-04-23 Thread Anton Khirnov
Quoting Andrew Sayers (2024-04-23 11:51:00) > On Tue, Apr 23, 2024 at 11:21:27AM +0200, Anton Khirnov wrote: > > > lavu/opt: Clarify that AVOptions is not indended for general use > > > > They _are_ intended for general use though. > > In that case I'm confused... &

Re: [FFmpeg-devel] [PATCH v2] lavu/opt: Clarify that AVOptions is not indended for general use

2024-04-23 Thread Anton Khirnov
> lavu/opt: Clarify that AVOptions is not indended for general use They _are_ intended for general use though. -- Anton Khirnov ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscr

Re: [FFmpeg-devel] [PATCH] ffmpeg: Carry streamid as metadata key 'id'

2024-04-16 Thread Anton Khirnov
data key 'id' > > This allows using -map_metadata and -metadata to copy/set streamids (PIDs). I dislike this patch, metadata is the wrong place for such information. -- Anton Khirnov ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmp

[FFmpeg-devel] resignation from CC

2024-04-13 Thread Anton Khirnov
Hi all, I am hereby resigning from my position as a CC member, since I do not want to be associated with the CC's utter lack of initiative and meaningful action. -- Anton Khirnov ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org

[FFmpeg-devel] [PATCH 06/10] lavc/hevc_ps/HEVCSPS: change flags into size-1 bitfields

2024-04-10 Thread Anton Khirnov
Reduces sizeof(HEVCSPS) by 96 bytes. Also improve flag names: drop redundant suffixes and prefixes, and consistently use disabled/enabled. --- libavcodec/dxva2_hevc.c| 24 - libavcodec/hevc_cabac.c| 36 ++--- libavcodec/hevc_filter.c | 8 +--

[FFmpeg-devel] [PATCH 10/10] lavc/hevc_ps: compactify ShortTermRPS

2024-04-10 Thread Anton Khirnov
Do not use larger fields than needed, use size-1 bitfields for flags. Reduces sizeof(HEVCSPS) by 1280 bytes. --- libavcodec/hevc_ps.c | 6 +++--- libavcodec/hevc_ps.h | 19 +++ libavcodec/vulkan_hevc.c | 2 +- 3 files changed, 15 insertions(+), 12 deletions(-) diff

[FFmpeg-devel] [PATCH 09/10] lavc/hevc_ps: reduce the size of ShortTermRPS.used

2024-04-10 Thread Anton Khirnov
It is currently an array of 32 uint8_t, each storing a single flag. A single uint32_t is sufficient. Reduces sizeof(HEVCSPS) by 1792 bytes. --- libavcodec/hevc_ps.c | 33 +++-- libavcodec/hevc_ps.h | 2 +- libavcodec/hevc_refs.c | 6 +++---

[FFmpeg-devel] [PATCH 08/10] lavc/hevc_ps: do not store delta_poc_s[01] in ShortTermRPS

2024-04-10 Thread Anton Khirnov
They are only used in vulkan_hevc and are not actually needed, as they can be computed from delta_poc. Reduces sizeof(HEVCSPS) by 16kB. --- libavcodec/hevc_ps.c | 4 ++-- libavcodec/hevc_ps.h | 2 -- libavcodec/vulkan_hevc.c | 7 +-- 3 files changed, 7 insertions(+), 6 deletions(-)

[FFmpeg-devel] [PATCH 07/10] lavc/hevc_ps: fix variable signedness in ff_hevc_decode_short_term_rps()

2024-04-10 Thread Anton Khirnov
It is actually supposed to go negative in the loop over num_negative pics, but underflow does not break anything as the result is then assigned to a signed int. --- libavcodec/hevc_ps.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/hevc_ps.c

[FFmpeg-devel] [PATCH 05/10] lavc/hevc_ps: reduce the size of used_by_curr_pic_lt_sps_flag

2024-04-10 Thread Anton Khirnov
It is currently an array of 32 uint8_t, each storing a single flag. A single uint32_t is sufficient. --- libavcodec/hevc_ps.c | 4 +++- libavcodec/hevc_ps.h | 2 +- libavcodec/hevcdec.c | 2 +- libavcodec/vulkan_hevc.c | 3 +-- 4 files changed, 6 insertions(+), 5 deletions(-) diff

[FFmpeg-devel] [PATCH 03/10] lavc/hevcdec: allocate local_ctx as array of structs rather than pointers

2024-04-10 Thread Anton Khirnov
It is more efficient and easier to manage. --- libavcodec/hevcdec.c | 57 +--- libavcodec/hevcdec.h | 2 +- 2 files changed, 33 insertions(+), 26 deletions(-) diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index 55f72af972..47226ef0ab 100644 ---

[FFmpeg-devel] [PATCH 04/10] lavc/hevcdec: drop a useless execute() call with 1 job

2024-04-10 Thread Anton Khirnov
--- libavcodec/hevcdec.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index 47226ef0ab..6b2c0b75ee 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -2526,9 +2526,8 @@ static void

  1   2   3   4   5   6   7   8   9   10   >