39 {63, 0},{15,15},{31,63},{47,31},{ 0,16},{14,32},{13,47},{11,13},
40 { 7,14},{ 5,11},{10,12},{ 8, 5},{12,10},{61, 7},{ 4,48},{55, 3},
41 { 1, 2},{ 2, 8},{59, 4},{ 3, 1},{62,61},{ 9,55},{ 6,59},{29,62},
42 {45,29},{51,27},{23,23},{39,19},{27,30},{46,28},{53, 9},{30, 6},
43 {43,60},{37,21},{60,44},{16,26},{21,51},{28,35},{19,18},{35,20},
44 {42,24},{26,53},{44,17},{32,37},{58,39},{24,45},{20,58},{17,43},
45 {18,42},{48,46},{22,36},{33,33},{25,34},{49,40},{40,52},{36,49},
46 {34,50},{50,56},{52,25},{54,22},{41,54},{56,57},{38,41},{57,38}
66 int m = col_mv->
x >> 31;
73 pmv_fw->
x = (((den+(den*col_mv->
x*pmv_fw->
dist^m)-m-1)>>14)^m)-m;
74 pmv_bw->
x = m-(((den+(den*col_mv->
x*pmv_bw->
dist^m)-m-1)>>14)^m);
76 pmv_fw->
y = (((den+(den*col_mv->
y*pmv_fw->
dist^m)-m-1)>>14)^m)-m;
77 pmv_bw->
y = m-(((den+(den*col_mv->
y*pmv_bw->
dist^m)-m-1)>>14)^m);
116 const struct dec_2dvlc *
r,
int esc_golomb_order,
117 int qp, uint8_t *dst,
int stride) {
131 mask = -(level_code & 1);
132 level = (level^
mask) - mask;
133 }
else if (level_code >= 0) {
134 level = r->
rltab[level_code][0];
137 run = r->
rltab[level_code][1];
138 r += r->
rltab[level_code][2];
142 level_buf[i] =
level;
168 if(cbp > 63 || cbp < 0){
177 for(block=0;block<4;block++)
178 if(h->
cbp & (1<<block))
194 unsigned pred_mode_uv;
197 uint8_t *left =
NULL;
203 for(block=0;block<4;block++) {
209 predpred =
FFMIN(nA,nB);
214 predpred = rem_mode + (rem_mode >= predpred);
219 if(pred_mode_uv > 6) {
228 if(cbp_code > 63 || cbp_code < 0 ){
237 for(block=0;block<4;block++) {
242 if(h->
cbp & (1<<block))
324 for(block=0;block<4;block++)
339 for(block=0;block<4;block++)
341 for(block=0;block<4;block++) {
342 switch(sub_type[block]) {
366 for(block=0;block<4;block++) {
433 "weighted prediction not yet supported\n");
657 const uint8_t *buf = avpkt->
data;
658 int buf_size = avpkt->
size;
662 const uint8_t *buf_end;
663 const uint8_t *buf_ptr;
672 *picture = h->
DPB[0].
f;
673 memset(&h->
DPB[0], 0,
sizeof(h->
DPB[0]));
679 buf_end = buf + buf_size;
682 if((stc & 0xFFFFFE00) || buf_ptr == buf_end)
684 input_size = (buf_end - buf_ptr)*8;
void(* intra_pred_c[7])(uint8_t *d, uint8_t *top, uint8_t *left, int stride)
static unsigned int show_bits_long(GetBitContext *s, int n)
Show 0-32 bits.
void ff_cavs_modify_mb_i(AVSContext *h, int *pred_mode_uv)
int(* get_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called at the beginning of each frame to get a buffer for it.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define SLICE_MAX_START_CODE
const uint8_t ff_zigzag_direct[64]
int direct_den[2]
for scaling in direct B block
static int get_se_golomb(GetBitContext *gb)
read signed exp golomb code.
const struct dec_2dvlc ff_cavs_chroma_dec[5]
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 void skip_bits_long(GetBitContext *s, int n)
av_cold int ff_cavs_end(AVCodecContext *avctx)
int mbidx
macroblock coordinates
const uint8_t ff_cavs_chroma_qp[64]
const AVRational avpriv_frame_rate_tab[16]
void ff_cavs_init_mb(AVSContext *h)
initialise predictors for motion vectors and intra prediction
static int dequant(AVSContext *h, DCTELEM *level_buf, uint8_t *run_buf, DCTELEM *dst, int mul, int shift, int coeff_num)
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
static int decode_seq_header(AVSContext *h)
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
static int cavs_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
static const uint8_t mv_scan[4]
cavs_vector mv[2 *4 *3]
mv motion vector cache 0: D3 B2 B3 C2 4: A1 X0 X1 - 8: A3 X2 X3 -
static void decode_mb_b(AVSContext *h, enum cavs_mb mb_type)
static int get_bits_count(const GetBitContext *s)
bitstream reader API header.
static void cavs_flush(AVCodecContext *avctx)
uint8_t idct_permutation[64]
idct input permutation.
void ff_cavs_filter(AVSContext *h, enum cavs_mb mb_type)
in-loop deblocking filter for a single macroblock
int dist[2]
temporal distances from current frame to ref frames
static int init(AVCodecParserContext *s)
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
int scale_den[2]
for scaling neighbouring MVs
const uint8_t ff_cavs_scan3x3[4]
const struct dec_2dvlc ff_cavs_intra_dec[7]
static int get_ue_golomb(GetBitContext *gb)
read unsigned exp golomb code.
static int decode_pic(AVSContext *h)
static const uint16_t mask[17]
int ff_cavs_next_mb(AVSContext *h)
save predictors for later macroblocks and increase macroblock address
void ff_cavs_inter(AVSContext *h, enum cavs_mb mb_type)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int decode_slice_header(AVSContext *h, GetBitContext *gb)
static void decode_mb_p(AVSContext *h, enum cavs_mb mb_type)
static const uint8_t cbp_tab[64][2]
void av_log(void *avcl, int level, const char *fmt,...)
void ff_cavs_load_intra_pred_luma(AVSContext *h, uint8_t *top, uint8_t **left, int block)
const char * name
Name of the codec implementation.
int low_delay
no reordering needed / has no b-frames
void(* clear_block)(DCTELEM *block)
int skip_mode_flag
select between skip_count or one skip_flag per MB
uint8_t * cv
current MB sample pointers
void ff_cavs_load_intra_pred_chroma(AVSContext *h)
static int check_for_slice(AVSContext *h)
int stream_revision
0 for samples from 2006, 1 for rm52j encoder
void ff_cavs_init_pic(AVSContext *h)
av_cold int ff_cavs_init(AVCodecContext *avctx)
uint8_t left_border_u[10]
int width
picture width / height.
int idct_algo
IDCT algorithm, see FF_IDCT_* below.
const uint8_t ff_cavs_partition_flags[30]
void ff_cavs_init_top_lines(AVSContext *h)
some predictions require data from the top-neighbouring macroblock.
void(* intra_pred_l[8])(uint8_t *d, uint8_t *top, uint8_t *left, int stride)
static unsigned int show_bits(GetBitContext *s, int n)
Show 1-25 bits.
Picture picture
currently decoded frame
const cavs_vector ff_cavs_dir_mv
mark block as "no prediction from this direction" e.g.
uint8_t left_border_v[10]
av_cold int MPV_common_init(MpegEncContext *s)
init common structure for both encoder and decoder.
const uint8_t ff_cavs_dequant_shift[64]
void ff_cavs_mv(AVSContext *h, enum cavs_mv_loc nP, enum cavs_mv_loc nC, enum cavs_mv_pred mode, enum cavs_block size, int ref)
#define AVERROR_PATCHWELCOME
Not yet implemented in Libav, patches welcome.
static void decode_residual_chroma(AVSContext *h)
const uint8_t * avpriv_mpv_find_start_code(const uint8_t *restrict p, const uint8_t *end, uint32_t *restrict state)
static void mv_pred_direct(AVSContext *h, cavs_vector *pmv_fw, cavs_vector *col_mv)
main external API structure.
int sym_factor
for scaling in symmetrical B block
static void close(AVCodecParserContext *s)
int height
picture size. must be a multiple of 16
int pred_mode_Y[3 *3]
luma pred mode cache 0: – B2 B3 3: A1 X0 X1 6: A3 X2 X3
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
struct AVPicture AVPicture
four components are given, that's all.
static unsigned int get_bits1(GetBitContext *s)
static void skip_bits1(GetBitContext *s)
static void skip_bits(GetBitContext *s, int n)
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
DSPContext dsp
pointers for accelerated dsp functions
static void store_mvs(AVSContext *h)
#define PIC_PB_START_CODE
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
struct AVCodecContext * avctx
const struct dec_2dvlc ff_cavs_inter_dec[7]
static av_cold void flush(AVCodecContext *avctx)
Flush (reset) the frame ID after seeking.
static void mv_pred_sym(AVSContext *h, cavs_vector *src, enum cavs_block size)
int flags
availability flags of neighbouring macroblocks
static int get_ue_code(GetBitContext *gb, int order)
kth-order exponential golomb code
void ff_init_scantable(uint8_t *permutation, ScanTable *st, const uint8_t *src_scantable)
static void set_mv_intra(AVSContext *h)
ParseContext parse_context
const uint16_t ff_cavs_dequant_mul[64]
static int decode_mb_i(AVSContext *h, int cbp_code)
static int decode_residual_block(AVSContext *h, GetBitContext *gb, const struct dec_2dvlc *r, int esc_golomb_order, int qp, uint8_t *dst, int stride)
decode coefficients from one 8x8 block, dequantize, inverse transform and add them to sample block ...
static void set_mvs(cavs_vector *mv, enum cavs_block size)
static int decode_residual_inter(AVSContext *h)
#define CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
void av_log_missing_feature(void *avc, const char *feature, int want_sample)
Log a generic warning message about a missing feature.
void(* cavs_idct8_add)(uint8_t *dst, DCTELEM *block, int stride)
Picture DPB[2]
reference frames
static void set_intra_mode_default(AVSContext *h)