51 #define H263_MBTYPE_B_VLC_BITS 6
52 #define CBPC_B_VLC_BITS 3
156 unsigned int val, gob_number;
168 for(;left>13; left--){
219 if (!p[-1] && p[1])
return p - 1;
220 else if(!p[ 1] && p[2])
return p;
252 for(;left>16+1+5+5; left-=8){
274 int code, val, sign, shift;
286 val = (val - 1) << shift;
299 if (pred < -31 && val < -63)
301 if (pred > 32 && val > 63)
327 code = (sign) ? (pred - code) : (pred + code);
339 int cbpc, i, pred_x, pred_y, mx, my;
356 mot_val[0 ]= mot_val[2 ]=
358 mot_val[1 ]= mot_val[3 ]=
379 if ((cbpc & 16) == 0) {
393 mot_val[0 ]= mot_val[2 ]=
395 mot_val[1 ]= mot_val[3 ]=
410 if (s->
umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1)
429 static const int8_t quant_tab[4] = { -1, -2, 1, 2 };
462 #if CONFIG_RV10_DECODER
465 component = (n <= 3 ? 0 : n - 4 + 1);
472 level = level & 0xff;
485 if((level&0x7F) == 0){
532 last = code >= rl->
last;
574 for (i = 0; i < 6; i++) {
589 if (pb_frame == 2 && c)
604 int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant;
607 int cbpb = 0, pb_mv_count = 0;
646 cbp = (cbpc & 3) | (cbpy << 2);
652 if ((cbpc & 16) == 0) {
675 if (s->
umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1)
697 if (s->
umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1)
711 mot_val0[0 ]= mot_val0[2 ]= mot_val0[0+2*
stride]= mot_val0[2+2*
stride]=
712 mot_val0[1 ]= mot_val0[3 ]= mot_val0[1+2*
stride]= mot_val0[3+2*
stride]=
713 mot_val1[0 ]= mot_val1[2 ]= mot_val1[0+2*
stride]= mot_val1[2+2*
stride]=
714 mot_val1[1 ]= mot_val1[3 ]= mot_val1[1+2*
stride]= mot_val1[3+2*
stride]= 0;
745 cbp = (cbpc & 3) | (cbpy << 2);
772 mot_val[0 ]= mot_val[2 ]= mot_val[0+2*
stride]= mot_val[2+2*
stride]= mx;
773 mot_val[1 ]= mot_val[3 ]= mot_val[1+2*
stride]= mot_val[3+2*
stride]= my;
785 mot_val[0 ]= mot_val[2 ]= mot_val[0+2*
stride]= mot_val[2+2*
stride]= mx;
786 mot_val[1 ]= mot_val[3 ]= mot_val[1+2*
stride]= mot_val[3+2*
stride]= my;
823 cbp = (cbpc & 3) | (cbpy << 2);
831 while(pb_mv_count--){
837 for (i = 0; i < 6; i++) {
877 startcode = ((startcode << 8) |
get_bits(&s->
gb, 8)) & 0x003FFFFF;
879 if(startcode == 0x20)
883 if (startcode != 0x20) {
916 if (format != 7 && format != 6) {
980 }
else if (ufep != 0) {
1018 av_dlog(s->
avctx,
"\nH.263+ Custom picture: %dx%d\n",width,height);
1031 if ((width == 0) || (height == 0))
1135 for(i=0; i<13; i++){
int rv10_first_dc_coded[3]
int last
number of values for last = 0
ScanTable intra_v_scantable
const uint8_t ff_cbpc_b_tab[4][2]
static int h263_decode_gob_header(MpegEncContext *s)
Decode the group of blocks header or slice header.
VLC ff_h263_inter_MCBPC_vlc
const uint8_t * y_dc_scale_table
qscale -> y_dc_scale table
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static void align_get_bits(GetBitContext *s)
const uint8_t ff_h263_intra_MCBPC_code[9]
const uint8_t ff_h263_cbpy_tab[16][2]
void ff_init_rl(RLTable *rl, uint8_t static_store[2][2 *MAX_RUN+MAX_LEVEL+3])
int obmc
overlapped block motion compensation
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel...
av_dlog(ac->avr,"%d samples - audio_convert: %s to %s (%s)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic?ac->func_descr_generic:ac->func_descr)
const int8_t * table_level
const uint16_t ff_h263_format[8][2]
int mb_num
number of MBs of a picture
const uint8_t ff_modified_quant_tab[2][32]
static int get_sbits(GetBitContext *s, int n)
int h263_aic
Advanded INTRA Coding (AIC)
int16_t * ff_h263_pred_motion(MpegEncContext *s, int block, int dir, int *px, int *py)
#define USES_LIST(a, list)
does this mb use listX, note does not work if subMBs
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
int alt_inter_vlc
alternative inter vlc
int mb_num_left
number of MBs left in this video packet (for partitioned Slices only)
int64_t time
time of current frame
#define MV_DIRECT
bidirectional mode where the difference equals the MV of the last P/S/I-Frame (mpeg4) ...
#define CONFIG_FLV_DECODER
#define INIT_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size)
const uint8_t ff_h263_intra_MCBPC_bits[9]
const uint8_t ff_mvtab[33][2]
static VLC h263_mbtype_b_vlc
int64_t pts
presentation timestamp in time_base units (time when frame should be shown to user) If AV_NOPTS_VALUE...
int no_rounding
apply no rounding to motion compensation (MPEG4, msmpeg4, ...) for b-frames rounding mode is always 0...
const uint8_t ff_h263_inter_MCBPC_bits[28]
Picture current_picture
copy of the current picture structure.
GetBitContext last_resync_gb
used to search for the next resync marker
static int get_bits_count(const GetBitContext *s)
char av_get_picture_type_char(enum AVPictureType pict_type)
Return a single letter to describe the given picture type pict_type.
uint16_t pp_time
time distance between the last 2 p,s,i frames
int mb_height
number of MBs horizontally & vertically
static int h263_skip_b_part(MpegEncContext *s, int cbp)
#define LOCAL_ALIGNED_16(t, v,...)
int codec_tag
internal codec_tag upper case converted from avctx codec_tag
const AVRational ff_h263_pixel_aspect[16]
void ff_set_qscale(MpegEncContext *s, int qscale)
set qscale and update qscale dependent variables.
#define FF_ASPECT_EXTENDED
static int get_bits_left(GetBitContext *gb)
#define H263_MBTYPE_B_VLC_BITS
int h263_plus
h263 plus headers
int last_dc[3]
last DC values for MPEG1
int mb_skipped
MUST BE SET only during DECODING.
int unrestricted_mv
mv can point outside of the coded picture
int ff_h263_decode_motion(MpegEncContext *s, int pred, int f_code)
#define FF_DEBUG_PICT_INFO
static const int h263_mb_type_b_map[15]
int h263_slice_structured
#define INTER_MCBPC_VLC_BITS
int64_t av_gcd(int64_t a, int64_t b)
Return the greatest common divisor of a and b.
void av_log(void *avcl, int level, const char *fmt,...)
void ff_mpeg4_init_direct_mv(MpegEncContext *s)
static int h263_get_modb(GetBitContext *gb, int pb_frame, int *cbpb)
VLC vlc
decoding only deprecated FIXME remove
void(* clear_block)(DCTELEM *block)
#define INIT_VLC_RL(rl, static_size)
struct AVRational AVRational
rational number numerator/denominator
int n
number of entries of table_vlc minus 1
int ff_h263_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
int umvplus
== H263+ && unrestricted_mv
Picture * current_picture_ptr
pointer to the current picture
static unsigned int show_bits(GetBitContext *s, int n)
Show 1-25 bits.
static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE(*table)[2], int bits, int max_depth)
Parse a vlc code.
int block_last_index[12]
last non zero coefficient in block
int pb_frame
PB frame mode (0 = none, 1 = base, 2 = improved)
const uint8_t ff_aic_dc_scale_table[32]
int ff_h263_decode_mba(MpegEncContext *s)
const uint8_t ff_h263_inter_MCBPC_code[28]
static int h263p_decode_umotion(MpegEncContext *s, int pred)
int block_index[6]
index to current MB in block based arrays with edges
static const float pred[4]
static const int8_t mv[256][2]
uint32_t * mb_type
macroblock type table mb_type_base + mb_width + 2
#define MV_TYPE_16X16
1 vector for the whole mb
int h263_flv
use flv h263 header
uint8_t ff_h263_static_rl_table_store[2][2][2 *MAX_RUN+MAX_LEVEL+3]
ScanTable intra_scantable
int height
picture size. must be a multiple of 16
const uint8_t ff_mpeg1_dc_scale_table[128]
int16_t(*[2] motion_val)[2]
motion vector table
#define SLICE_END
end marker found
VLC ff_h263_intra_MCBPC_vlc
static unsigned int get_bits1(GetBitContext *s)
static void skip_bits1(GetBitContext *s)
ScanTable intra_h_scantable
static void skip_bits(GetBitContext *s, int n)
#define CONFIG_MPEG4_DECODER
const uint8_t * ff_h263_find_resync_marker(const uint8_t *restrict p, const uint8_t *restrict end)
Find the next resync_marker.
DSPContext dsp
pointers for accelerated dsp functions
int ff_h263_resync(MpegEncContext *s)
Decode the group of blocks / video packet header.
int f_code
forward MV resolution
int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my)
int ff_h263_decode_picture_header(MpegEncContext *s)
int pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
DCTELEM(* block)[64]
points to one of the following blocks
const uint8_t ff_h263_mbtype_b_tab[15][2]
static av_const int sign_extend(int val, unsigned bits)
static void h263_decode_dquant(MpegEncContext *s)
int h263_pred
use mpeg4/h263 ac/dc predictions
const uint8_t * c_dc_scale_table
qscale -> c_dc_scale table
int mv[2][4][2]
motion vectors for a macroblock first coordinate : 0 = forward 1 = backward second " : depend...
int b8_stride
2*mb_width+1 used for some 8x8 block arrays to allow simple addressing
void(* clear_blocks)(DCTELEM *blocks)
static int h263_decode_block(MpegEncContext *s, DCTELEM *block, int n, int coded)
struct AVCodecContext * avctx
void ff_h263_pred_acdc(MpegEncContext *s, DCTELEM *block, int n)
int mb_stride
mb_width+1 used for some arrays to allow simple addressing of left & top MBs without sig11 ...
const uint8_t ff_h263_chroma_qscale_table[32]
static int get_unary(GetBitContext *gb, int stop, int len)
Get unary code of limited length.
int ff_rv_decode_dc(MpegEncContext *s, int n)
const uint8_t * chroma_qscale_table
qscale -> chroma_qscale (h263)
void ff_h263_show_pict_info(MpegEncContext *s)
Print picture info if FF_DEBUG_PICT_INFO is set.
VLC_TYPE(* table)[2]
code, bits
int chroma_qscale
chroma QP
void ff_h263_decode_init_vlc(MpegEncContext *s)
static void preview_obmc(MpegEncContext *s)
read the next MVs for OBMC.
int rv10_version
RV10 version: 0 or 3.
int ff_mpeg4_decode_video_packet_header(MpegEncContext *s)
Decode the next video packet.
int h263_long_vectors
use horrible h263v1 long vector mode
#define MV_TYPE_8X8
4 vectors (h263, mpeg4 4MV)
int h263_aic_dir
AIC direction: 0 = left, 1 = top.
void ff_flv2_decode_ac_esc(GetBitContext *gb, int *level, int *run, int *last)
#define INTRA_MCBPC_VLC_BITS
uint16_t pb_time
time distance between the last b and p,s,i frame