Go to the documentation of this file.
83 *
u++ = (
val >> 10) & 0x3FF;
84 *y++ = (
val >> 20) & 0x3FF;
89 *y++ = (
val >> 10) & 0x3FF;
92 *
u++ = (
val >> 20) & 0x3FF;
95 *v++ = (
val >> 10) & 0x3FF;
98 *y++ = (
val >> 20) & 0x3FF;
112 int slice_start = (avctx->
height * jobnr) /
s->thread_count;
114 uint8_t *psrc =
td->buf +
stride * slice_start;
115 int16_t *py = (uint16_t*)
frame->data[0] + slice_start *
frame->linesize[0] / 2;
116 int16_t *pu = (uint16_t*)
frame->data[1] + slice_start *
frame->linesize[1] / 2;
117 int16_t *
pv = (uint16_t*)
frame->data[2] + slice_start *
frame->linesize[2] / 2;
122 py +=
frame->linesize[0] / 2;
123 pu +=
frame->linesize[1] / 2;
131 int aligned_width = ((
width + align - 1) / align) * align;
132 return aligned_width * 8 / 3;
141 const uint8_t *psrc = avpkt->
data;
143 if (
s->custom_stride )
144 stride =
s->custom_stride > 0 ?
s->custom_stride : 0;
149 for (align = 24; align >= 6; align >>= 1) {
151 if (avpkt->
size == small_stride * avctx->
height) {
153 if (!
s->stride_warning_shown)
154 av_log(avctx,
AV_LOG_WARNING,
"Broken v210 with too small padding (%d byte) detected\n", align * 8 / 3);
155 s->stride_warning_shown = 1;
159 if (align < 6 && avctx->codec_tag ==
MKTAG(
'b',
'x',
'y',
'2'))
180 aligned_input = !((uintptr_t)psrc & 0x1f) && !(
stride & 0x1f);
181 if (aligned_input !=
s->aligned_input) {
182 s->aligned_input = aligned_input;
194 td.buf = (uint8_t*)psrc;
220 #define V210DEC_FLAGS AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM
static const AVOption v210dec_options[]
#define AV_LOG_WARNING
Something somehow does not look correct.
static int v210_stride(int width, int align)
#define u(width, name, range_min, range_max)
static av_cold int decode_init(AVCodecContext *avctx)
This structure describes decoded (raw) audio or video data.
enum AVFieldOrder field_order
Field order.
#define READ_PIXELS(a, b, c)
int top_field_first
If the content is interlaced, is top field displayed first.
static int decode_frame(AVCodecContext *avctx, AVFrame *pic, int *got_frame, AVPacket *avpkt)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
AVCodec p
The public AVCodec.
int thread_count
thread count is used to decide how many independent tasks should be passed to execute()
the pkt_dts and pkt_pts fields in AVFrame will work as usual Restrictions on codec whose streams don t reset across will not work because their bitstreams cannot be decoded in parallel *The contents of buffers must not be read before as well as code calling up to before the decode process starts Call have so the codec calls ff_thread_report set FF_CODEC_CAP_ALLOCATE_PROGRESS in AVCodec caps_internal and use ff_thread_get_buffer() to allocate frames. The frames must then be freed with ff_thread_release_buffer(). Otherwise decode directly into the user-supplied frames. Call ff_thread_report_progress() after some part of the current picture has decoded. A good place to put this is where draw_horiz_band() is called - add this if it isn 't called anywhere
static void unpack_frame(EVRCContext *e)
Frame unpacking for RATE_FULL, RATE_HALF and RATE_QUANT.
int key_frame
1 -> keyframe, 0-> not
static double val(void *priv, double ch)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define FF_CODEC_DECODE_CB(func)
static av_unused av_cold void ff_v210dec_init(V210DecContext *s)
static int slice_end(AVCodecContext *avctx, AVFrame *pict)
Handle slice ends.
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
Undefined Behavior In the C some operations are like signed integer dereferencing freed pointers
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
const char * av_default_item_name(void *ptr)
Return the context name.
@ AV_PICTURE_TYPE_I
Intra.
#define AV_PIX_FMT_YUV422P10
int av_image_alloc(uint8_t *pointers[4], int linesizes[4], int w, int h, enum AVPixelFormat pix_fmt, int align)
Allocate an image with size w and h and pixel format pix_fmt, and fill pointers and linesizes accordi...
enum AVPictureType pict_type
Picture type of the frame.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define AV_CODEC_CAP_SLICE_THREADS
Codec supports slice-based (or partition-based) multithreading.
const FFCodec ff_v210_decoder
static const AVClass v210dec_class
int interlaced_frame
The content of the picture is interlaced.
Used for passing data between threads.
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
const char * name
Name of the codec implementation.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
main external API structure.
static void decode_row(const uint32_t *src, uint16_t *y, uint16_t *u, uint16_t *v, const int width, void(*unpack_frame)(const uint32_t *src, uint16_t *y, uint16_t *u, uint16_t *v, int width))
void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], const uint8_t *src_data[4], const int src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height)
Copy image in src_data to dst_data.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
This structure stores compressed data.
static int v210_decode_slice(AVCodecContext *avctx, void *arg, int jobnr, int threadnr)
int width
picture width / height.
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.
#define MKTAG(a, b, c, d)
int(* execute2)(struct AVCodecContext *c, int(*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count)
The codec may call this to execute several independent things.