primary_ref_frame is an index into the seven reference names, but the
code assigned it the reference's DPB slot. The two coincide only while
the reference sits in slot 0; once it rotates to slot 1,
referenceNameSlotIndices[primary_ref_frame] is -1, which is invalid,
and NVIDIA drivers lose the device. Inherited from vaapi_encode_av1,
where the same confusion is harmless as the raw frame header maps
every reference name to the same slot.
Have set_name_slot() return the name it picked and use that.
Fixes#20540.
Host image layout transitions may only originate from a layout in
pCopySrcLayouts, or from UNDEFINED, discarding the contents. The host
transfer path transitioned from whatever layout the frame was last
left in, which for pool-recycled frames can be a video layout, which
no driver lists as host-copyable.
Uploads overwrite the entire image, so transition from UNDEFINED
there. Downloads have to preserve the contents, so route frames in a
non-host-copyable layout through the GPU path.
The function sized every import from src_data to the end of the source
buffer. For packets which are small views of a much larger allocation,
this pinned and mapped every page of the underlying allocation, at
around 1.6us per page, regardless of what the GPU ever touches.
Take the import length as a VkDeviceSize, clamped to the end of the
source buffer; the clamp doubles as the implementation of
VK_WHOLE_SIZE.
The setup shader statically uses the fltmap binding, but the decoder
only bound a buffer to it for float formats, leaving a dangling
descriptor on everything else, with the write reachable by any
bitstream signalling remap.
Gate remap on a new push-constant flag, so that streams signalling it
without a fltmap buffer error out, and point the descriptor at the
slice feedback buffer when no fltmap exists; the gate guarantees it is
never written through this binding.
Decode output which doubles as reference frames (COINCIDE mode)
remains an active DPB slot for as long as the decoder keeps
referencing it, and decode submissions bake the image layout into
their barriers at record time. A host-side layout transition can
therefore not be synchronized against them, and host transfers of such
frames were found to corrupt image contents on Intel once frame
threading varied the submission order.
Do not set VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT on such frames. This
makes the incompatibility visible through the usage flags, and routes
our own transfer path through the queue.
slice_count is only set while decoding a frame, so the warning always
printed a slice count of 0 at init time, and fired on streams with
plenty of slices.
A frame's private data is allocated before start_frame(), and its free
callback runs even if setup failed partway, so partially-initialized
private data has to be tolerated everywhere: inter frames reffed the
previous frame's slice state without checking it exists, end_frame()
waited on a semaphore that was never created, and the free callback
read a feedback buffer that was never allocated or written. Inter
frames after a failed frame now error out until the next keyframe.
Also set the device function pointers before anything can fail, as the
free callback needs them.
Superseded by SSE4. This makes the huffyuv decoders ABI compliant,
e.g. nothing messes up the FPU state at all any more. Therefore
the emms_c() can be removed from huffyuvdec.c.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Heavily based upon the existing mmxext function, but
it allows to use p{max,min}uw, so also supports 16bpp
pixel formats. It is also faster:
add_hfyu_median_pred_int16_c: 14368.1
add_hfyu_median_pred_int16_mmxext: 7384.2 ( 1.94x)
add_hfyu_median_pred_int16_sse4: 6474.4 ( 2.21x)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Both source and dst are always properly aligned (to stride align)
here; also document this fact.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
The current logic would stop demuxing the entire manifest once the first Representation
returned EOF, which could result in plenty of packets from other Representations being
lost.
Signed-off-by: James Almer <jamrial@gmail.com>
Based on a patch by Michael Niedermayer
Fixes: unbounded allocation
Fixes: poc_output_mix_config_dos.iamf
Fixes: 387qWpjUgeKH
Found-by: Duong Tran Thai (CyStack)
Signed-off-by: James Almer <jamrial@gmail.com>
Up until now ff_vc1_v_loop_filter4_ssse3 used MMX registers
despite being an SSSE3 function. Porting it to XMM registers
didn't lead to any change in benchmarks here, but abides
by the ABI (one function less that does not omit emms).
Unfortunately the size of the function increased by 64B
by this.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Using XMM registers in this SSSE3 function leads to fewer shuffles
when transposing the input; it also allows to combine calculating
a1 and a2. Because of this, codesize is the same as before (on Unix64)
although MMX instructions are shorter.
Old benchmarks:
vc1dsp.vc1_h_loop_filter4_bestcase_c: 3.0
vc1dsp.vc1_h_loop_filter4_bestcase_ssse3: 32.0 ( 0.09x)
vc1dsp.vc1_h_loop_filter4_worstcase_c: 42.9
vc1dsp.vc1_h_loop_filter4_worstcase_ssse3: 31.9 ( 1.35x)
New benchmarks:
vc1dsp.vc1_h_loop_filter4_bestcase_c: 3.0
vc1dsp.vc1_h_loop_filter4_bestcase_ssse3: 29.9 ( 0.10x)
vc1dsp.vc1_h_loop_filter4_worstcase_c: 43.7
vc1dsp.vc1_h_loop_filter4_worstcase_ssse3: 29.9 ( 1.46x)
Hint: checkasm's benchmark always uses the same buffer that is
partially updated by the horizontal loop filter function (the
middle two of eight columns are updated using word-sized stores).
They therefore lead to store-to-load-forwarding failure. If
checkasm_alternate were used to alternate between two buffers,
the benchmarks would be as follows:
Old benchmarks:
vc1dsp.vc1_h_loop_filter4_bestcase_c: 3.0
vc1dsp.vc1_h_loop_filter4_bestcase_ssse3: 16.4 ( 0.18x)
vc1dsp.vc1_h_loop_filter4_worstcase_c: 23.9
vc1dsp.vc1_h_loop_filter4_worstcase_ssse3: 16.3 ( 1.47x)
New benchmarks:
vc1dsp.vc1_h_loop_filter4_bestcase_c: 3.0
vc1dsp.vc1_h_loop_filter4_bestcase_ssse3: 15.1 ( 0.20x)
vc1dsp.vc1_h_loop_filter4_worstcase_c: 23.6
vc1dsp.vc1_h_loop_filter4_worstcase_ssse3: 15.2 ( 1.55x)
Notice that at some callsites, the partially modified buffer
is immediately reloaded again*, so that both scenarios can happen.
*: See the TT_4X4 and TT_4X8 cases at the end of vc1_p_h_loop_filter()
or vc1_b_h_intfi_loop_filter() or the luma field blocks in
vc1_p_h_intfr_loop_filter().
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
In particular, apply the rounding before adding the result
of the multiplication. No change in performance here.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Reuse the register that held pq for this instead of using
another one. This saves a push+pop on 32bit systems and avoids
REX prefixes on Unix64.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Multipliying a GPR by 0x01010101 splats a byte to a dword;
the intention was to avoid vector shuffles lateron, yet
this is not true because the byte splat necessitates
a byte->word conversion lateron.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Due to the earlier "if (a1 < a0 || a2 < a0)" check
it is guaranteed that min(a1,a2) is < a0, allowing
simplifications.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
vf_dnn_processing.c and vf_dnn_detect.c both declare an uninitialized
DNNData model_input before using it. This commit initialize it.
Signed-off-by: younengxiao <steven.xiao@amd.com>
Add a new muxer option mpegts_pcr_pid that generates PCR on a dedicated
adaptation-field-only PID, separate from any elementary stream.
ISDB-T 1seg receivers require PCR on a standalone PID. When PCR shares
the video PID, these receivers acquire the service but refuse to decode
video and audio. This is standard practice in Japanese digital
terrestrial broadcasting per ARIB TR-B14.
When mpegts_pcr_pid is set to a valid PID value:
- PCR packets are generated as adaptation-field-only packets on the
specified PID at the interval set by pcr_period
- The video stream adaptation fields do not carry PCR flags
- The PMT PCR_PID field is set to the specified PID
When mpegts_pcr_pid is -1 (default): existing behavior is unchanged.
The existing mpegts_insert_pcr_only function is refactored into a
parameterized mpegts_insert_pcr_only_pid(s, pid, cc, discontinuity)
to avoid code duplication.
Fixes: https://code.ffmpeg.org/FFmpeg/FFmpeg/issues/23649
Signed-off-by: shadowcaster3 <vasyl.samoilov@gmail.com>
Use m aliases instead of xmm registers directly so that certain macros
can work (e.g. SWAP); likewise replace movdqa with mova
Signed-off-by: Zuxy Meng <zuxy.meng@gmail.com>
RTSP redirects retain URL credentials and authentication state when a
Location URI changes to another origin. This can forward reusable
credentials to a server with a different scheme, host, or port.
Clear the stored credentials and authentication state when the redirect
crosses an origin boundary. Preserve them for same-origin redirects.
Fixes: cross-origin credential disclosure
Fixes: rtsp_redirect_auth_leak_poc.py
Fixes: VaKaPOnfN02z