49 for (i = 0; i < 256; i++) {
61 while (he[last].len == 255 && last)
64 if (he[last].len > 32)
68 for (i = last; i >= 0; i--) {
69 codes[i] = code >> (32 - he[i].
len);
72 code += 0x80000000u >> (he[i].
len - 1);
76 bits,
sizeof(*bits),
sizeof(*bits),
77 codes,
sizeof(*codes),
sizeof(*codes),
78 syms,
sizeof(*syms),
sizeof(*syms), 0);
99 for (slice = 0; slice < c->
slices; slice++) {
103 send = (height * (slice + 1) / c->
slices) & cmask;
104 dest = dst + sstart *
stride;
107 for (j = sstart; j < send; j++) {
108 for (i = 0; i < width * step; i += step) {
125 for (slice = 0; slice < c->
slices; slice++) {
127 int slice_data_start, slice_data_end, slice_size;
130 send = (height * (slice + 1) / c->
slices) & cmask;
131 dest = dst + sstart *
stride;
134 slice_data_start = slice ?
AV_RL32(src + slice * 4 - 4) : 0;
135 slice_data_end =
AV_RL32(src + slice * 4);
136 slice_size = slice_data_end - slice_data_start;
140 "yet a slice has a length of zero.\n");
149 (slice_data_end - slice_data_start + 3) >> 2);
153 for (j = sstart; j < send; j++) {
154 for (i = 0; i < width * step; i += step) {
157 "Slice decoding ran out of bits\n");
192 for (j = 0; j <
height; j++) {
193 for (i = 0; i < width * step; i += step) {
197 src[i] = r + g - 0x80;
198 src[i + 2] = b + g - 0x80;
210 int slice_start, slice_height;
211 const int cmask = ~rmode;
213 for (slice = 0; slice < slices; slice++) {
214 slice_start = ((slice *
height) / slices) & cmask;
215 slice_height = ((((slice + 1) * height) / slices) & cmask) -
220 bsrc = src + slice_start *
stride;
225 for (i = step; i < width * step; i += step) {
230 if (slice_height <= 1)
236 for (i = step; i < width * step; i += step) {
244 for (j = 2; j < slice_height; j++) {
245 for (i = 0; i < width * step; i += step) {
266 int slice_start, slice_height;
267 const int cmask = ~(rmode ? 3 : 1);
268 const int stride2 = stride << 1;
270 for (slice = 0; slice < slices; slice++) {
271 slice_start = ((slice *
height) / slices) & cmask;
272 slice_height = ((((slice + 1) * height) / slices) & cmask) -
278 bsrc = src + slice_start *
stride;
283 for (i = step; i < width * step; i += step) {
287 for (i = 0; i < width * step; i += step) {
288 bsrc[stride + i] +=
A;
289 A = bsrc[stride + i];
292 if (slice_height <= 1)
298 for (i = step; i < width * step; i += step) {
299 B = bsrc[i - stride2];
304 for (i = 0; i < width * step; i += step) {
308 A = bsrc[stride + i];
312 for (j = 2; j < slice_height; j++) {
313 for (i = 0; i < width * step; i += step) {
314 B = bsrc[i - stride2];
319 for (i = 0; i < width * step; i += step) {
334 int buf_size = avpkt->
size;
338 int plane_size, max_slice_size = 0, slice_start,
slice_end, slice_size;
348 for (i = 0; i < c->
planes; i++) {
349 plane_start[i] = gb.
buffer;
357 for (j = 0; j < c->
slices; j++) {
358 slice_end = bytestream2_get_le32u(&gb);
359 slice_size = slice_end - slice_start;
360 if (slice_end < 0 || slice_size < 0 ||
366 max_slice_size =
FFMAX(max_slice_size, slice_size);
398 for (i = 0; i < c->
planes; i++) {
401 avctx->
height, plane_start[i],
422 for (i = 0; i < 3; i++) {
443 for (i = 0; i < 3; i++) {
484 "Insufficient extradata size %d, should be at least 16\n",
507 case MKTAG(
'U',
'L',
'R',
'G'):
511 case MKTAG(
'U',
'L',
'R',
'A'):
515 case MKTAG(
'U',
'L',
'Y',
'0'):
520 case MKTAG(
'U',
'L',
'Y',
'2'):
525 case MKTAG(
'U',
'L',
'H',
'0'):
530 case MKTAG(
'U',
'L',
'H',
'2'):
static void restore_median(uint8_t *src, int step, int stride, int width, int height, int slices, int rmode)
void(* bswap_buf)(uint32_t *dst, const uint32_t *src, int w)
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
ptrdiff_t const GLvoid * data
#define AV_LOG_WARNING
Something somehow does not look correct.
packed RGB 8:8:8, 24bpp, RGBRGB...
static av_cold int init(AVCodecContext *avctx)
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 ...
int ff_init_vlc_sparse(VLC *vlc_arg, int nb_bits, int nb_codes, const void *bits, int bits_wrap, int bits_size, const void *codes, int codes_wrap, int codes_size, const void *symbols, int symbols_wrap, int symbols_size, int flags)
static int decode_plane(UtvideoContext *c, int plane_no, uint8_t *dst, int step, int stride, int width, int height, const uint8_t *src, int use_pred)
static av_cold int decode_end(AVCodecContext *avctx)
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
Multithreading support functions.
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
static void restore_median_il(uint8_t *src, int step, int stride, int width, int height, int slices, int rmode)
static av_always_inline void bytestream2_skipu(GetByteContext *g, unsigned int size)
bitstream reader API header.
int interlaced_frame
The content of the picture is interlaced.
const int ff_ut_rgb_order[4]
static int build_huff(const uint8_t *src, VLC *vlc, int *fsym)
static int get_bits_left(GetBitContext *gb)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_cold int decode_init(AVCodecContext *avctx)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static av_always_inline unsigned int bytestream2_get_bytes_left(GetByteContext *g)
const char * name
Name of the codec implementation.
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
enum AVPictureType pict_type
Picture type of the frame.
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.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
static void restore_rgb_planes(uint8_t *src, int step, int stride, int width, int height)
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Libavcodec external API header.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
Wrapper around get_buffer() for frame-multithreaded codecs.
main external API structure.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
BYTE int const BYTE int int int height
enum AVColorSpace colorspace
YUV colorspace type.
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
int ff_ut_huff_cmp_len(const void *a, const void *b)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt)
GLint GLenum GLboolean GLsizei stride
void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size)
Allocate a buffer, reusing the given one if large enough.
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
static int slice_end(AVCodecContext *avctx, AVFrame *pict)
Handle slice ends.
av_cold void ff_bswapdsp_init(BswapDSPContext *c)
VLC_TYPE(* table)[2]
code, bits
int key_frame
1 -> keyframe, 0-> not
#define MKTAG(a, b, c, d)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
AVCodec ff_utvideo_decoder
This structure stores compressed data.
void ff_free_vlc(VLC *vlc)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.