27 #define BITSTREAM_READER_LE 39 { 0x17F, 9 }, { 0xBF, 8 }, { 0x5F, 7 }, { 0x2F, 6 }, { 0x17, 5 }, { 0x0B, 4 }, { 0x005, 3 },
41 { 0x01, 3 }, { 0x03, 4 }, { 0x07, 5 }, { 0x0F, 6 }, { 0x1F, 7 }, { 0x3F, 8 }, { 0x07F, 9 }, { 0xFF, 8 }
44 #define CODE_VLC_BITS 9 55 return base_value + ((v - 7
U) << w->
shift);
59 void *
data,
int *got_frame,
64 int buf_size = avpkt->
size;
66 unsigned char *
Y,*
U,*
V;
68 int prev_y = 0, prev_u = 0, prev_v = 0;
70 if (buf_size < 8 + avctx->
height * (avctx->
width/2)/8) {
85 l->
shift = 8 - (buf[2] >> 4);
88 "Unknown WNV1 frame header value %i",
94 "Unknown WNV1 frame header value %i",
103 for (j = 0; j < avctx->
height; j++) {
104 for (i = 0; i < avctx->
width / 2; i++) {
125 if (avctx->
width <= 1)
130 code_vlc.
table = code_table;
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static av_cold int init(AVCodecContext *avctx)
#define avpriv_request_sample(...)
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
#define init_vlc(vlc, nb_bits, nb_codes, bits, bits_wrap, bits_size, codes, codes_wrap, codes_size, flags)
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
bitstream reader API header.
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
#define i(width, name, range_min, range_max)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
const char * name
Name of the codec implementation.
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
static int wnv1_get_code(WNV1Context *w, int base_value)
int width
picture width / height.
static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE(*table)[2], int bits, int max_depth)
Parse a vlc code.
Libavcodec external API header.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
main external API structure.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal api header.
static const uint16_t code_tab[16][2]
#define INIT_VLC_USE_NEW_STATIC
VLC_TYPE(* table)[2]
code, bits
int key_frame
1 -> keyframe, 0-> not
static av_cold int decode_init(AVCodecContext *avctx)
This structure stores compressed data.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.