32 #define BITSTREAM_READER_LE
77 for(j=0; j<value; j++)
82 block[perm[i]] = -s->
qtable[perm[i]];
87 block[perm[i]] = s->
qtable[perm[i]];
108 uint8_t *dest_y = s->
frame.
data[0] + (mb_y * 16* linesize ) + mb_x * 16;
123 int level = av_clip_uint8((dc*s->
qtable[0] + 2056)>>4);
126 memset(dst+j*dst_stride, level, 8);
132 uint8_t *dest_y = s->
frame.
data[0] + (mb_y * 16* linesize ) + mb_x * 16;
137 tgq_dconly(s,dest_y + 8*linesize , linesize, dc[2]);
138 tgq_dconly(s,dest_y + 8*linesize + 8, linesize, dc[3]);
150 mode = bytestream2_get_byte(&s->
gb);
160 memset(dc, bytestream2_get_byte(&s->
gb), 4);
161 dc[4] = bytestream2_get_byte(&s->
gb);
162 dc[5] = bytestream2_get_byte(&s->
gb);
165 }
else if (mode==12) {
166 for (i = 0; i < 6; i++) {
167 dc[i] = bytestream2_get_byte(&s->
gb);
179 const int a = (14*(100-
quant))/100 + 1;
180 const int b = (11*(100-
quant))/100 + 4;
186 s->
qtable[j*8+i] = (a*(j+i)/(7+7) +
b)<<3;
190 void *
data,
int *data_size,
192 const uint8_t *buf = avpkt->
data;
193 int buf_size = avpkt->
size;
196 int big_endian =
AV_RL32(&buf[4]) > 0x000FFFFF;
204 s->
width = bytestream2_get_be16u(&s->
gb);
205 s->
height = bytestream2_get_be16u(&s->
gb);
207 s->
width = bytestream2_get_le16u(&s->
gb);
208 s->
height = bytestream2_get_le16u(&s->
gb);
int(* get_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called at the beginning of each frame to get a buffer for it.
enum PixelFormat pix_fmt
Pixel format, see PIX_FMT_xxx.
const uint8_t ff_zigzag_direct[64]
#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 unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static int tgq_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
#define AV_LOG_WARNING
Something somehow does not look correct.
#define DECLARE_ALIGNED(n, t, v)
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
static int get_sbits(GetBitContext *s, int n)
static av_cold int tgq_decode_init(AVCodecContext *avctx)
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
static void tgq_idct_put_mb_dconly(TgqContext *s, int mb_x, int mb_y, const int8_t *dc)
bitstream reader API header.
uint8_t idct_permutation[64]
idct input permutation.
av_cold void dsputil_init(DSPContext *c, AVCodecContext *avctx)
void avcodec_set_dimensions(AVCodecContext *s, int width, int height)
static int init(AVCodecParserContext *s)
#define CODEC_FLAG_GRAY
Only decode/encode grayscale.
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
static void tgq_decode_block(TgqContext *s, DCTELEM block[64], GetBitContext *gb)
void(* idct_put)(uint8_t *dest, int line_size, DCTELEM *block)
block -> idct -> clip to unsigned 8 bit -> dest.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
static void tgq_dconly(TgqContext *s, unsigned char *dst, int dst_stride, int dc)
struct TgqContext TgqContext
const uint8_t * buffer_end
struct AVRational AVRational
rational number numerator/denominator
enum AVPictureType pict_type
Picture type of the frame, see ?_TYPE below.
int width
picture width / height.
struct AVFrame AVFrame
Audio Video Frame.
int idct_algo
IDCT algorithm, see FF_IDCT_* below.
static unsigned int show_bits(GetBitContext *s, int n)
Show 1-25 bits.
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
const uint16_t ff_inv_aanscales[64]
main external API structure.
static void close(AVCodecParserContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static void skip_bits(GetBitContext *s, int n)
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
AAN (Arai Agui Nakajima) (I)DCT tables.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static void tgq_idct_put_mb(TgqContext *s, DCTELEM(*block)[64], int mb_x, int mb_y)
static av_cold int tgq_decode_end(AVCodecContext *avctx)
void ff_init_scantable(uint8_t *permutation, ScanTable *st, const uint8_t *src_scantable)
int key_frame
1 -> keyframe, 0-> not
static void tgq_decode_mb(TgqContext *s, int mb_y, int mb_x)
static void tgq_calculate_qtable(TgqContext *s, int quant)