27 #define BITSTREAM_READER_LE
47 static const uint8_t LUT[256] = {
48 8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
49 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
50 6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
51 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
52 7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
53 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
54 6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
55 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
59 for (i = 0; i < ctx->
size; i++) {
74 allbits += ctx->
val[i];
90 int i, j, left, left_top;
92 for (i = 0; i <
height; i++) {
93 for (j = 0; j <
width; j++) {
96 int v = (1 << val[j]) +
get_bits(gb, val[j]) - 1;
97 val[j] = (v >> 1) ^ -(v & 1);
106 for (j = 1; j <
width; j++)
107 dst[j] = val[j] + dst[j - 1];
123 int width_uv = avctx->
width / 2, height_uv = avctx->
height / 2;
126 if (avpkt->
size < 4 || avpkt->
size - 4 > INT_MAX/8) {
161 offset += width_uv * height_uv;
const char const char void * val
av_cold void ff_dsputil_init(DSPContext *c, AVCodecContext *avctx)
This structure describes decoded (raw) audio or video data.
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
#define AV_LOG_WARNING
Something somehow does not look correct.
static av_cold int init(AVCodecContext *avctx)
static int vble_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
void av_freep(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
static const uint8_t offset[511][2]
const char * name
Name of the codec implementation.
static int vble_unpack(VBLEContext *ctx, GetBitContext *gb)
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
bitstream reader API header.
static int get_bits_left(GetBitContext *gb)
#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. ...
Libavcodec external API header.
void(* add_hfyu_median_prediction)(uint8_t *dst, const uint8_t *top, const uint8_t *diff, int w, int *left, int *left_top)
enum AVPictureType pict_type
Picture type of the frame.
int width
picture width / height.
void * av_malloc(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
static unsigned int show_bits(GetBitContext *s, int n)
Show 1-25 bits.
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
main external API structure.
static void close(AVCodecParserContext *s)
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
static av_cold int vble_decode_close(AVCodecContext *avctx)
static unsigned int get_bits1(GetBitContext *s)
BYTE int const BYTE int int int height
static void skip_bits(GetBitContext *s, int n)
uint8_t * val
This array first holds the lengths of vlc symbols and then their value.
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
common internal api header.
#define CODEC_FLAG_GRAY
Only decode/encode grayscale.
static void vble_restore_plane(VBLEContext *ctx, AVFrame *pic, GetBitContext *gb, int plane, int offset, int width, int height)
#define AVERROR_INVALIDDATA
int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height)
Calculate the size in bytes that a picture of the given width and height would occupy if stored in th...
int key_frame
1 -> keyframe, 0-> not
static av_cold int vble_decode_init(AVCodecContext *avctx)
static int decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
This structure stores compressed data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.