Go to the documentation of this file.
29 #define BITSTREAM_READER_LE
36 { 7, 1 }, { 8, 3 }, { 6, 3 }, { 9, 4 }, { 5, 4 }, { 10, 5 }, { 4, 5 },
37 { 11, 6 }, { 3, 6 }, { 12, 7 }, { 2, 7 }, { 13, 8 }, { 1, 8 }, { 14, 9 },
41 #define CODE_VLC_BITS 9
52 return base_value + v * (1 <<
shift);
58 const uint8_t *buf = avpkt->
data;
59 int buf_size = avpkt->
size;
61 unsigned char *
Y,*
U,*
V;
63 int prev_y = 0, prev_u = 0, prev_v = 0;
65 if (buf_size < 8 + avctx->
height * (avctx->
width/2)/8) {
80 shift = 8 - (buf[2] >> 4);
83 "Unknown WNV1 frame header value %i",
89 "Unknown WNV1 frame header value %i",
98 for (j = 0; j < avctx->
height; j++) {
99 for (
i = 0;
i < avctx->
width / 2;
i++) {
128 if (avctx->
width <= 1)
This structure describes decoded (raw) audio or video data.
int flags
Frame flags, a combination of AV_FRAME_FLAGS.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
AVCodec p
The public AVCodec.
static VLCElem code_vlc[1<< CODE_VLC_BITS]
static av_cold int decode_init(AVCodecContext *avctx)
static int ff_thread_once(char *control, void(*routine)(void))
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
#define AV_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
static av_always_inline int get_vlc2(GetBitContext *s, const VLCElem *table, int bits, int max_depth)
Parse a vlc code.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
const FFCodec ff_wnv1_decoder
static int shift(int a, int b)
static int decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt)
static const uint8_t code_tab[16][2]
static av_cold void wnv1_init_static(void)
#define i(width, name, range_min, range_max)
const char * name
Name of the codec implementation.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static int wnv1_get_code(GetBitContext *gb, int shift, int base_value)
main external API structure.
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
#define avpriv_request_sample(...)
#define VLC_INIT_OUTPUT_LE
#define VLC_INIT_STATIC_TABLE_FROM_LENGTHS(vlc_table, nb_bits, nb_codes, lens, lens_wrap, syms, syms_wrap, syms_size, offset, flags)
This structure stores compressed data.
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.