28 #define BITSTREAM_READER_LE
39 const unsigned char *src_end,
40 unsigned char *dst,
int dst_size)
48 for (i = 0, sz = 0; i < 64 && sz < dst_size; i++) {
52 sz +=
FFABS(code_table[i]);
57 for (i = 0; i < 64 && dst_size > 0; i++) {
61 if (src_end - src < 1)
63 memset(dst, *src++,
FFMIN(len, dst_size));
65 if (src_end - src < len)
67 memcpy(dst, src,
FFMIN(len, dst_size));
77 const unsigned char *src,
78 const unsigned char *src_end,
84 unsigned char block[8 * 8];
86 if (src_end - src < 1)
93 for (b = 0; b < 8; b++) {
94 memcpy(dst, &block[b * 8], 8);
100 for (i = 0; i < 8; i++) {
101 for (b = 0; b < 8; b++)
111 if (src_end - src < len + 8 * bits)
116 for (b = 0; b < 8; b++) {
117 for (i = 0; i < 8; i++)
118 dst[i] = color_table[
get_bits(&gb, bits)];
127 const unsigned char *src,
128 const unsigned char *src_end,
133 if (src_end - src < 8 * 8)
136 for (i = 0; i < 8; i++) {
146 const unsigned char *src,
147 const unsigned char *src_end,
153 if (src_end - src < 2)
156 offset = ((pos >> 3) & 7) * seq->
frame.
linesize[0] + (pos & 7);
157 dst[offset] = *src++;
158 }
while (!(pos & 0x80));
165 const unsigned char *data_end = data + data_size;
175 palette = (uint32_t *)seq->
frame.
data[1];
176 if (data_end - data < 256 * 3)
178 for (i = 0; i < 256; i++) {
179 for (j = 0; j < 3; j++, data++)
180 c[j] = (*data << 2) | (*data >> 4);
187 if (data_end - data < 128)
190 for (y = 0; y < 128; y += 8)
191 for (x = 0; x < 256; x += 8) {
225 void *
data,
int *data_size,
228 const uint8_t *buf = avpkt->
data;
229 int buf_size = avpkt->
size;
260 .
name =
"tiertexseqvideo",
enum PixelFormat pix_fmt
Pixel format, see PIX_FMT_xxx.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define FF_BUFFER_HINTS_VALID
int buffer_hints
codec suggestion on buffer type if != 0
void(* release_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called to release buffers which were allocated with get_buffer.
static ColorEntry color_table[]
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static av_cold int seqvideo_decode_end(AVCodecContext *avctx)
static av_cold int seqvideo_decode_init(AVCodecContext *avctx)
static int seqvideo_decode(SeqVideoContext *seq, const unsigned char *data, int data_size)
const uint8_t ff_log2_tab[256]
static int get_sbits(GetBitContext *s, int n)
int(* reget_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called at the beginning of a frame to get cr buffer for it.
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
static int get_bits_count(const GetBitContext *s)
bitstream reader API header.
struct SeqVideoContext SeqVideoContext
static int init(AVCodecParserContext *s)
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
static int get_bits_left(GetBitContext *gb)
static const unsigned char * seq_unpack_rle_block(const unsigned char *src, const unsigned char *src_end, unsigned char *dst, int dst_size)
int reference
is this picture used as reference The values for this are the same as the MpegEncContext.picture_structure variable, that is 1->top field, 2->bottom field, 3->frame/both fields.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
static const unsigned char * seq_decode_op3(SeqVideoContext *seq, const unsigned char *src, const unsigned char *src_end, unsigned char *dst)
struct AVFrame AVFrame
Audio Video Frame.
static const unsigned char * seq_decode_op1(SeqVideoContext *seq, const unsigned char *src, const unsigned char *src_end, unsigned char *dst)
#define FF_BUFFER_HINTS_REUSABLE
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
main external API structure.
static void close(AVCodecParserContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int seqvideo_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
#define FF_BUFFER_HINTS_PRESERVE
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
int palette_has_changed
Tell user application that palette has changed from previous frame.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
AV_WL32 AV_WL24 AV_WL16 AV_WB32 AV_RB24
8 bit with PIX_FMT_RGB32 palette
static const unsigned char * seq_decode_op2(SeqVideoContext *seq, const unsigned char *src, const unsigned char *src_end, unsigned char *dst)
static int op(uint8_t **dst, const uint8_t *dst_end, const uint8_t **buf, const uint8_t *buf_end, int pixel, int count, int *x, int width, int linesize)
Perform decode operation.
AVCodec ff_tiertexseqvideo_decoder