Fix the commit ab794ce70 (2023-11-23) that fixed (incorrectly) the
CID 424197.
If should_exit was set before waiting in pthread_cond_timedwait, the
infinite loop is never left. Moreover, it seems that the loop was left
only on should_exit timeout, not when notified by condition variable.
This is mostly to make Coverity happy - the spurious wakeup here does
not matter in any way. So reverting the original "fix" would be enough.
If both encoder and decoder of the same name is present, eg. jpeg2000,
print help for both encoder and decoder. Since for the decoder, options
are also printed with enc=<enc>:help, print both enc and dec at the
same time.
In case that set_param callback modifies some field use a copy to be
reentrant for next attempted pixfmt (or reconfiguration).
The other alternative would be to set the pointer to setparam struct
const, but some setters currenty really modify the params.
User may be tempted to set the bitrate although CRF is now default,
so unset pred-struct (because it won't work with current
ffmpeg/libxsvtav1).
But issue a (serious) warning in this case.
This reverts commit fa8bb8ca8e.
Actually this worsened the behavior significantly by increasing the
latency in the order of 100 frames (depending on properties). This
(currently) disallows setting the bitrate, using CRF/CQP is only possible
because the FFmpeg plugin isn't able to set CBR for now.
set_forced_idr function was unnecessary - the error handling can now
do chec_av_opt_set(). Moreover it prints out the setting to std output
even when succeeded.
this fixes CID 464474
Although quite serious, this didn't exhibit problem so far, because:
1. dump_tree is not so much often called
2. the mutex is recursive (doubtfull if it won't be better if they
weren't), so that this will be tolerant to re-locking from the same thread
Fixed correctly the problem that was incorrectly attempted by the
previous commit revert. should_exit doesn't need to be checked with the
main while loop because it is done by the inner one.
refers to CID 464439
Actually not much important - the m_started variable is not shared across
threads but should be used only from within the main thread (start()
stop() member functions).
Replace _source_ r,g,b magic numbers and variables with new constants
indicating that the shift applies on input (not output as usual for the
rgb shifts in fnction declaration /for out RGBA only/).
Written is 16 bytes but the required allocate buffer is guaranteed only
12 bytes. Although there is a padding for the conversions in general,
it shouldn't be relied on, especciall when the rest is computed without
the vector instruction (needless if we rely on the fact that there is
additional space in buffer - we could then do one more iteration if not
aligned on the blk instruction boundaries).
- guard vc_copylineRGBAtoRGBwithShift() with #ifndef __SSSE3__ (otherwise not used)
- moved the UNUSED() to common part (readibility - to indicate that the
value doesn't matter in either #ifdef branch)
- fixed computing last words (dereferenced uchar but should have been uint32_t)
set fast-decode as suggested by SVT AV1:
```
Svt[warn]: If you are using tiles with the intent of increasing the
decoder speed, please also consider using --fast-decode 1, especially if
the intended decoder is running with limited multi-threading capabilities.
````
currently it causes following error:
```
Svt[error]: VBR Rate control is currently not supported for SVT_AV1_PRED_LOW_DELAY_B, use CBR mode
```
Setting the CBR mode is currently not possible with current FFmpeg patch
- only possibility is to set rc_max_rate=bit_rate ([1] but this triggers
another error:
```
Svt[error]: Instance 1: Max Bitrate only supported with CRF mode
Svt[error]: CBR Rate control is currently not supported for SVT_AV1_PRED_RANDOM_ACCESS, use VBR mode
```
It is also not clear if the pred-struct set to SVT_AV1_PRED_LOW_DELAY_B
has some impact in situation when UG does not use B frames.
[1]: 5d54a25eea/libavcodec/libsvtav1.c (L224)
Together with the previous revert commit fixes CID 464437.
In addition to incorrect change to unsigned, also parenthesis around
(height - 1) were missing.