Go to the documentation of this file.
26 #include <SvtJpegxsDec.h>
54 case COLOUR_FORMAT_PLANAR_YUV420:
55 if (
config->bit_depth == 8)
57 else if (
config->bit_depth == 10)
59 else if (
config->bit_depth == 12)
64 case COLOUR_FORMAT_PLANAR_YUV422:
65 if (
config->bit_depth == 8)
67 else if (
config->bit_depth == 10)
69 else if (
config->bit_depth == 12)
74 case COLOUR_FORMAT_PLANAR_YUV444_OR_RGB:
75 if (
config->bit_depth == 8)
77 else if (
config->bit_depth == 10)
79 else if (
config->bit_depth == 12)
96 SvtJxsErrorType_t err = SvtJxsErrorNone;
100 err = svt_jpeg_xs_decoder_get_single_frame_size_with_proxy(
103 av_log(avctx,
AV_LOG_ERROR,
"svt_jpeg_xs_decoder_get_single_frame_size_with_proxy failed, err=%d\n", err);
122 svt_jpeg_xs_decoder_close(&svt_dec->
decoder);
123 err = svt_jpeg_xs_decoder_init(SVT_JPEGXS_API_VER_MAJOR, SVT_JPEGXS_API_VER_MINOR,
144 svt_dec->
input.bitstream.buffer = avpkt->
data;
145 svt_dec->
input.bitstream.allocation_size = avpkt->
size;
146 svt_dec->
input.bitstream.used_size = avpkt->
size;
147 svt_dec->
input.user_prv_ctx_ptr = avpkt;
153 unsigned pixel_shift = svt_dec->
config.bit_depth <= 8 ? 0 : 1;
160 err = svt_jpeg_xs_decoder_send_frame(&svt_dec->
decoder, &svt_dec->
input, 1 );
166 err = svt_jpeg_xs_decoder_get_frame(&svt_dec->
decoder, &svt_dec->
output, 1 );
172 if (svt_dec->
output.user_prv_ctx_ptr != avpkt) {
186 svt_jpeg_xs_decoder_close(&svt_dec->
decoder);
197 log_level ==
AV_LOG_DEBUG ? VERBOSE_SYSTEM_INFO : VERBOSE_WARNINGS;
200 svt_dec->
decoder.proxy_mode = proxy_mode_half;
201 else if (avctx->
lowres == 2)
202 svt_dec->
decoder.proxy_mode = proxy_mode_quarter;
204 svt_dec->
decoder.proxy_mode = proxy_mode_full;
208 svt_dec->
decoder.use_cpu_flags = CPU_FLAGS_ALL;
214 .
p.
name =
"libsvtjpegxs",
215 CODEC_LONG_NAME(
"SVT JPEG XS(Scalable Video Technology for JPEG XS) decoder"),
227 .p.wrapper_name =
"libsvtjpegxs",
svt_jpeg_xs_frame_t output
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static void comp(unsigned char *dst, ptrdiff_t dst_stride, unsigned char *src, ptrdiff_t src_stride, int add)
@ AV_PIX_FMT_YUV422P14LE
planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
This structure describes decoded (raw) audio or video data.
static int svt_jpegxs_dec_decode(AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *avpkt)
uint32_t decoder_initialized
svt_jpeg_xs_decoder_api_t decoder
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
int ff_set_dimensions(AVCodecContext *s, int width, int height)
Check that the provided frame dimensions are valid and set them on the codec context.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static av_cold int svt_jpegxs_dec_free(AVCodecContext *avctx)
static av_cold void close(AVCodecParserContext *s)
AVCodec p
The public AVCodec.
@ AV_PIX_FMT_YUV420P12LE
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
enum AVDiscard skip_frame
Skip decoding for selected frames.
int thread_count
thread count is used to decide how many independent tasks should be passed to execute()
const FFCodec ff_libsvtjpegxs_decoder
@ AV_PIX_FMT_YUV420P10LE
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
@ AV_PIX_FMT_YUV444P12LE
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
@ AV_PIX_FMT_YUV444P14LE
planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int set_pix_fmt(void *logctx, const svt_jpeg_xs_image_config_t *config)
#define FF_CODEC_DECODE_CB(func)
#define AV_CODEC_CAP_OTHER_THREADS
Codec supports multithreading through a method other than slice- or frame-level multithreading.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static av_cold int svt_jpegxs_dec_init(AVCodecContext *avctx)
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
#define CODEC_LONG_NAME(str)
@ AV_PIX_FMT_YUV444P10LE
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
@ AVDISCARD_ALL
discard all
int av_log_get_level(void)
Get the current log level.
@ AV_PIX_FMT_YUV420P14LE
planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
int lowres
low resolution decoding, 1-> 1/2 size, 2->1/4 size
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
int(* init)(AVBSFContext *ctx)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
@ AV_PIX_FMT_YUV422P10LE
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
#define FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM
The decoder extracts and fills its parameters even if the frame is skipped due to the skip_frame sett...
#define AVERROR_EXTERNAL
Generic error in an external library.
const char * name
Name of the codec implementation.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
svt_jpeg_xs_frame_t input
main external API structure.
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
#define FF_CODEC_CAP_AUTO_THREADS
Codec handles avctx->thread_count == 0 (auto) internally.
This structure stores compressed data.
int width
picture width / height.
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
svt_jpeg_xs_image_config_t config
@ AV_PIX_FMT_YUV422P12LE
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian