Samples made following the current (for now) faulty specification may not
include alignment bits at the end of VUI parameters, so instead of erroring
out, warn about it and keep going.
In a writing scenario, like the lcevc_metadata bsf, the output bitstream will
be written with them.
Signed-off-by: James Almer <jamrial@gmail.com>
put_signed_rect_clamped uses different types for differnt
8bit and >8bit content. The 8bit SSE2 function used the real
type in its function signature; this does not coincide with
the array of function pointers it gets put into and therefore
also not with how it is called which is UB. Also, casts of
function pointers to void* like it is done here are not
legal ISO-C as function pointers and object pointers need not
be convertible.
So just declare the function to have the required type for
the function pointer array.
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
{ADD,PUT}_RECT was only used once since the removal of
mmx functions in d29a9c2aa6.
Furthermore, several of the INIT_XMM calls lacked the
actual cpuflags. Therefore the cpu flag suffix has been
manually added to the function names; furthermore, cpuflags()
as well as the check for supported instructions wouldn't work.
So add the cpu flags to INIT_XMM.
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
packusdw saturates to uint16_t, yet CLIPW is designed for signed values.
If any of the saturated unsigned values were >= 2^16*, the macro would
return 0. Anyway, given that packusdw already saturates below,
clipping from both sides again is simply wasteful.
*: I don't know whether this can happen at all.
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Pass the input value by value and return the output value
as return value and not by passing the input value by reference.
This improves decoding speed by 2% here.
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
The decoder has been made to use unsigned values after
the fuzzer encountered signed integer overflow;
the same can probably happen in the encoder (I don't know),
but it definitely can happen in the checkasm test that
will be added soon. So use unsigned here, too.
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Implement the fixed-point LFE x96 interpolation filter in AArch64
NEON. Four input samples are processed per iteration. The history
sample is kept in a vector lane, and ext constructs the delayed input.
Benchmarks by Martin Storsjö using checkasm:
a53 a55 a520 a72 a76 a720
1.86x 1.88x 1.24x 1.99x 1.62x 2.30x
Author's measurement on Neoverse-N1 (Oracle Cloud, clang 14): 1.29x.
Signed-off-by: Jeongkeun Kim <variety0724@gmail.com>
Mantissas are the last data in the channel subsegment and it appears it
is sometimes missing a very few bits for the parsing to complete.
This must not be confused with data corruption.
In standard conditions with certified products, it has been observed
that the occurence of this issue is pretty steady and about once every 2
hours. The truncation is at about 950 out of the 1024 values (923 is the
minimum I have seen so far).
The current code raises a severe 'Read past end' error and all data is
lost resulting in 20ms(@25fps) of silence for the affected channel.
This patch introduces a tolerance: if 800 out of the 1024 mantissas have
been parsed, a simple warning is raised and the data is preserved.
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Execution contexts track at most a few dozen dependencies so dynamically
growing the arrays was just stupid, and ARR_REALLOC required the field
name to also exist as a local variable.
Pool depth sets how far the CPU records ahead of the GPU, and has no relation
to the number of queues in a family.
Scaling it by the queue count only multiplied command pools, fences and context state.
Use a small fixed depth everywhere, and one context per thread only for threadsafe hwaccels,
which submit from every frame thread concurrently.
armasm64 warns "A4228: Alignment value exceeds AREA alignment; alignment
not guaranteed" on the .Lcoeffs literal pool. gas-preprocessor.pl emits
the text section as "AREA |.text|, CODE, READONLY, ALIGN=4", i.e. a
16-byte section alignment, so a 32-byte ALIGN inside it cannot be
guaranteed by the assembler.
16 is enough here: the pool holds .quad values that are read with
"ldr d0, .Lcoeffs" literal loads, which only require 8-byte alignment.
It also matches the rest of the aarch64 asm, where the function and
const macros both default to .align 4.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Cisco's ISVCDecoder retains DPB and reference state across
avcodec_flush_buffers(), causing the next IDR to be accepted but
subsequent P-frames to fail decode after a seek or loop. Cisco's
API does not expose a non-destructive reset; tear down and rebuild
the decoder via the existing close/init callbacks.
The .flush callback is void and cannot report a re-init failure, so
svc_decode_frame() guards against a NULL decoder left behind by a
failed re-init. svc_decode_init() now also tears the decoder back
down on an Initialize() failure so that path leaves the same clean
NULL state the guard expects and does not leak the ISVCDecoder.
Signed-off-by: Scott Kidder <scott@kidder.io>
These shaders reduce across the subgroup after divergent control flow
and implicitly rely on invocations reconverging as written, the
MaximallyReconvergesKHR execution mode turns that assumption into a
guarantee.
Combinations of shift and add like
pslldq m3, m2, 1
paddb m2, m3
are linear in the input register m2. This implies
that instead of applying the same sequence of shifts and adds
to two different registers and adding said registers
one can just add the register first and then apply
said sequence of shifts and adds once.
Old benchmarks:
add_gradient_pred_c: 2296.2
add_gradient_pred_ssse3: 570.4 ( 3.95x)
add_gradient_pred_avx2: 308.8 ( 7.29x)
New benchmarks:
add_gradient_pred_c: 2315.6
add_gradient_pred_ssse3: 344.0 ( 6.72x)
add_gradient_pred_avx2: 205.2 (11.28x)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
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.
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.
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>