62 const int qscale= a->
qscale;
68 component = (n <= 3 ? 0 : n - 4 + 1);
73 block[0] = a->
last_dc[component]<<3;
86 }
else if(level != 0) {
89 level= (level*qscale*quant_matrix[j])>>3;
101 level= (level*qscale*quant_matrix[j])>>3;
105 level= (level*qscale*quant_matrix[j])>>3;
124 const int block_index[6]= {5,4,0,1,2,3};
140 uint8_t *dest_y = a->
picture.
data[0] + (mb_y * 16* linesize ) + mb_x * 16;
156 void *
data,
int *data_size,
159 const uint8_t *buf = avpkt->
data;
160 int buf_size = avpkt->
size;
180 for(i=0; i<buf_size; i+=2){
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
enum PixelFormat pix_fmt
Pixel format, see PIX_FMT_xxx.
static av_cold void mdec_common_init(AVCodecContext *avctx)
const uint8_t ff_zigzag_direct[64]
int qstride
QP store stride.
int coded_width
Bitstream width / height, may be different from width/height if lowres enabled.
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.
av_cold void ff_mpeg12_init_vlcs(void)
#define CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
AVFrame * coded_frame
the picture in the bitstream
static int decode_mb(MDECContext *a, DCTELEM block[6][64])
#define DECLARE_ALIGNED(n, t, v)
void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size)
Allocate a buffer, reusing the given one if large enough.
static int get_sbits(GetBitContext *s, int n)
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
static int mdec_decode_block_intra(MDECContext *a, DCTELEM *block, int n)
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_...
static int get_bits_count(const GetBitContext *s)
uint8_t idct_permutation[64]
idct input permutation.
av_cold void dsputil_init(DSPContext *c, AVCodecContext *avctx)
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.
const uint16_t ff_mpeg1_default_intra_matrix[64]
static int get_bits_left(GetBitContext *gb)
#define UPDATE_CACHE(name, gb)
Multithreading support functions.
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.
struct MDECContext MDECContext
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. ...
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
#define CLOSE_READER(name, gb)
static int decode_dc(GetBitContext *gb, int component)
#define SKIP_BITS(name, gb, num)
#define ONLY_IF_THREADS_ENABLED(x)
Define a function with only the non-default version specified.
enum AVPictureType pict_type
Picture type of the frame, see ?_TYPE below.
int idct_algo
IDCT algorithm, see FF_IDCT_* below.
#define GET_RL_VLC(level, run, name, gb, table, bits, max_depth, need_update)
unsigned int bitstream_buffer_size
int quality
quality (between 1 (good) and FF_LAMBDA_MAX (bad))
#define LAST_SKIP_BITS(name, gb, num)
uint8_t * bitstream_buffer
RL_VLC_ELEM * rl_vlc[32]
decoding only
#define SHOW_UBITS(name, gb, num)
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.
struct AVPicture AVPicture
four components are given, that's all.
#define OPEN_READER(name, gb)
static av_cold int decode_end(AVCodecContext *avctx)
static av_cold int decode_init_thread_copy(AVCodecContext *avctx)
static void skip_bits(GetBitContext *s, int n)
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
#define FF_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
static void idct_put(MDECContext *a, int mb_x, int mb_y)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int8_t * qscale_table
QP table.
void(* clear_blocks)(DCTELEM *blocks)
#define SHOW_SBITS(name, gb, num)
void ff_init_scantable(uint8_t *permutation, ScanTable *st, const uint8_t *src_scantable)
int key_frame
1 -> keyframe, 0-> not
#define FF_QP2LAMBDA
factor to convert from H.263 QP to lambda
static av_cold int decode_init(AVCodecContext *avctx)
int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f)
Wrapper around get_buffer() for frame-multithreaded codecs.
void ff_thread_release_buffer(AVCodecContext *avctx, AVFrame *f)
Wrapper around release_buffer() frame-for multithreaded codecs.
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)