35 int16_t (*right_block)[64],
int left_fieldtx,
36 int right_fieldtx,
int block_num)
42 left_fieldtx ^ right_fieldtx ? 16 - 8 * left_fieldtx : 8,
43 left_fieldtx ^ right_fieldtx ? 16 - 8 * right_fieldtx : 8,
44 left_fieldtx || right_fieldtx ? 0 : 1);
52 right_fieldtx ? 0 : 1);
57 left_fieldtx && !right_fieldtx ? right_block[0] + 8 : right_block[1],
58 left_fieldtx ^ right_fieldtx ? 16 - 8 * left_fieldtx : 8,
59 left_fieldtx ^ right_fieldtx ? 16 - 8 * right_fieldtx : 8,
60 left_fieldtx || right_fieldtx ? 2 : 1);
68 right_fieldtx ? 2 : 1);
79 int16_t (*bottom_block)[64],
int block_num)
108 int16_t (*topleft_blk)[64], (*top_blk)[64], (*left_blk)[64], (*cur_blk)[64];
126 for (i = 0; i < block_count; i++) {
127 if (s->
mb_x == 0 && (i & 5) != 1)
135 s->
mb_x ? left_blk : cur_blk, cur_blk,
142 for (i = 0; i < block_count; i++) {
164 int16_t (*topleft_blk)[64], (*top_blk)[64], (*left_blk)[64], (*cur_blk)[64];
174 for (i = 0; i < block_count; i++) {
175 if (s->
mb_x == 0 && (i & 5) != 1)
180 s->
mb_x ? left_blk : cur_blk, cur_blk,
187 for (i = 0; i < block_count; i++) {
201 #define LEFT_EDGE (1 << 0)
202 #define RIGHT_EDGE (1 << 1)
203 #define TOP_EDGE (1 << 2)
204 #define BOTTOM_EDGE (1 << 3)
207 uint32_t
flags,
int block_num)
216 if (!(flags &
LEFT_EDGE) || (block_num & 5) == 1) {
220 dst = dest + (block_num & 2) * 4 * s->
linesize + (block_num & 1) * 8;
246 if ((block_num & 5) == 1)
249 if (!(flags &
TOP_EDGE) || block_num & 2) {
253 dst = dest + (block_num & 2) * 4 * s->
linesize + (block_num & 1) * 8;
259 }
else if (block_num < 2 || !fieldtx) {
293 for (i = 0; i < block_count; i++)
299 for (i = 0; i < block_count; i++)
304 dest = s->
dest[0] - 16;
308 for (i = 0; i < block_count; i++)
314 for (i = 0; i < block_count; i++)
323 for (i = 0; i < block_count; i++)
329 for (i = 0; i < block_count; i++)
338 for (i = 0; i < block_count; i++)
344 for (i = 0; i < block_count; i++)
348 dest = s->
dest[0] - 16;
351 for (i = 0; i < block_count; i++)
357 for (i = 0; i < block_count; i++)
365 int *ttblk, uint32_t
flags,
int block_num)
369 uint32_t left_cbp = cbp[0] >> (block_num * 4), right_cbp;
370 uint8_t left_is_intra, right_is_intra;
378 dst = dest + (block_num & 2) * 4 * s->
linesize + (block_num & 1) * 8;
380 if (!(flags &
RIGHT_EDGE) || !(block_num & 5)) {
381 left_is_intra = is_intra[0] & (1 << block_num);
384 right_is_intra = is_intra[1] & (1 << block_num);
385 right_cbp = cbp[1] >> (block_num * 4);
386 }
else if (block_num & 1) {
387 right_is_intra = is_intra[1] & (1 << block_num - 1);
388 right_cbp = cbp[1] >> ((block_num - 1) * 4);
390 right_is_intra = is_intra[0] & (1 << block_num + 1);
391 right_cbp = cbp[0] >> ((block_num + 1) * 4);
394 if (left_is_intra || right_is_intra ||
395 mv[0][0] !=
mv[1][0] ||
mv[0][1] !=
mv[1][1] ||
399 idx = (left_cbp | (right_cbp >> 1)) & 5;
407 tt = ttblk[0] >> (block_num * 4) & 0
xf;
418 int *ttblk, uint32_t
flags,
int block_num)
422 uint32_t top_cbp = cbp[0] >> (block_num * 4), bottom_cbp;
423 uint8_t top_is_intra, bottom_is_intra;
431 dst = dest + (block_num & 2) * 4 * s->
linesize + (block_num & 1) * 8;
434 top_is_intra = is_intra[0] & (1 << block_num);
437 bottom_is_intra = is_intra[s->
mb_stride] & (1 << block_num);
438 bottom_cbp = cbp[s->
mb_stride] >> (block_num * 4);
439 }
else if (block_num < 2) {
440 bottom_is_intra = is_intra[0] & (1 << block_num + 2);
441 bottom_cbp = cbp[0] >> ((block_num + 2) * 4);
443 bottom_is_intra = is_intra[s->
mb_stride] & (1 << block_num - 2);
444 bottom_cbp = cbp[s->
mb_stride] >> ((block_num - 2) * 4);
447 if (top_is_intra || bottom_is_intra ||
453 idx = (top_cbp | (bottom_cbp >> 2)) & 3;
461 tt = ttblk[0] >> (block_num * 4) & 0
xf;
497 for (i = 0; i < block_count; i++)
517 for (i = 0; i < block_count; i++)
540 for (i = 0; i < block_count; i++)
553 dest = s->
dest[0] - 16;
559 for (i = 0; i < block_count; i++)
561 i > 3 ? s->
dest[i - 3] - 8 : dest,
580 for (i = 0; i < block_count; i++)
599 for (i = 0; i < block_count; i++)
601 i > 3 ? s->
dest[i - 3] : dest,
622 for (i = 0; i < block_count; i++)
643 for (i = 0; i < block_count; i++)
662 for (i = 0; i < block_count; i++)
685 for (i = 0; i < block_count; i++)
706 for (i = 0; i < block_count; i++)
725 for (i = 0; i < block_count; i++)
740 dest = s->
dest[0] - 32;
746 for (i = 0; i < block_count; i++)
748 i > 3 ? s->
dest[i - 3] - 16 : dest,
761 dest = s->
dest[0] - 16;
767 for (i = 0; i < block_count; i++)
769 i > 3 ? s->
dest[i - 3] - 8 : dest,
786 for (i = 0; i < block_count; i++)
788 i > 3 ? s->
dest[i - 3] : dest,
814 dst = dest + (block_num & 2) * 4 * s->
linesize + (block_num & 1) * 8;
816 tt = ttblk[0] >> (block_num * 4) & 0
xf;
835 if (!(flags &
RIGHT_EDGE) || !(block_num & 5)) {
864 dst = dest + (block_num & 2) * 4 * s->
linesize + (block_num & 1) * 8;
866 tt = ttblk[0] >> (block_num * 4) & 0
xf;
934 for (i = 0; i < block_count; i++)
949 for (i = 0; i < block_count; i++)
960 dest = s->
dest[0] - 16;
964 for (i = 0; i < block_count; i++)
966 i > 3 ? s->
dest[i - 3] - 8 : dest,
977 for (i = 0; i < block_count; i++)
979 i > 3 ? s->
dest[i - 3] : dest,
993 for (i = 0; i < block_count; i++)
1007 for (i = 0; i < block_count; i++)
1019 for (i = 0; i < block_count; i++)
1035 for (i = 0; i < block_count; i++)
1049 for (i = 0; i < block_count; i++)
1061 for (i = 0; i < block_count; i++)
1071 dest = s->
dest[0] - 32;
1075 for (i = 0; i < block_count; i++)
1077 i > 3 ? s->
dest[i - 3] - 16 : dest,
1085 dest = s->
dest[0] - 16;
1089 for (i = 0; i < block_count; i++)
1091 i > 3 ? s->
dest[i - 3] - 8 : dest,
1101 for (i = 0; i < block_count; i++)
1103 i > 3 ? s->
dest[i - 3] : dest,
1113 int *ttblk, uint32_t
flags,
int block_num)
1118 uint32_t block_cbp = cbp[0] >> (block_num * 4);
1125 dst = dest + (block_num & 2) * 4 * s->
linesize + (block_num & 1) * 8;
1127 if (!(flags &
RIGHT_EDGE) || !(block_num & 5)) {
1134 tt = ttblk[0] >> (block_num * 4) & 0
xf;
1136 idx = (block_cbp | (block_cbp >> 1)) & 5;
1145 int *ttblk, uint32_t
flags,
int block_num)
1150 uint32_t block_cbp = cbp[0] >> (block_num * 4);
1157 dst = dest + (block_num & 2) * 4 * s->
linesize + (block_num & 1) * 8;
1162 tt = ttblk[0] >> (block_num * 4) & 0
xf;
1164 idx = (block_cbp | (block_cbp >> 2)) & 3;
1193 for (i = 0; i < block_count; i++)
1201 for (i = 0; i < block_count; i++)
1211 for (i = 0; i < block_count; i++)
1219 for (i = 0; i < block_count; i++)
1224 dest = s->
dest[0] - 16;
1229 for (i = 0; i < block_count; i++)
1237 for (i = 0; i < block_count; i++)
int start_mb_y
start mb_y of this thread (so current thread should process start_mb_y <= row < end_mb_y) ...
void(* vc1_h_s_overlap)(int16_t *left, int16_t *right, int left_stride, int right_stride, int flags)
static av_always_inline void vc1_p_v_loop_filter(VC1Context *v, uint8_t *dest, uint32_t *cbp, uint8_t *is_intra, int16_t(*mv)[2], uint8_t *mv_f, int *ttblk, uint32_t flags, int block_num)
static av_always_inline void vc1_h_overlap_filter(VC1Context *v, int16_t(*left_block)[64], int16_t(*right_block)[64], int left_fieldtx, int right_fieldtx, int block_num)
int end_mb_y
end mb_y of this thread (so current thread should process start_mb_y <= row < end_mb_y) ...
static av_always_inline void vc1_p_h_loop_filter(VC1Context *v, uint8_t *dest, uint32_t *cbp, uint8_t *is_intra, int16_t(*mv)[2], uint8_t *mv_f, int *ttblk, uint32_t flags, int block_num)
static av_always_inline void vc1_p_v_intfr_loop_filter(VC1Context *v, uint8_t *dest, int *ttblk, uint32_t flags, uint8_t fieldtx, int block_num)
uint8_t * mv_f[2]
0: MV obtained from same field, 1: opposite field
int end_mb_x
Horizontal macroblock limit (used only by mss2)
void(* vc1_v_loop_filter8)(uint8_t *src, int stride, int pq)
void(* vc1_v_loop_filter4)(uint8_t *src, int stride, int pq)
static av_always_inline void vc1_i_h_loop_filter(VC1Context *v, uint8_t *dest, uint32_t flags, int block_num)
static av_always_inline void vc1_b_v_intfi_loop_filter(VC1Context *v, uint8_t *dest, uint32_t *cbp, int *ttblk, uint32_t flags, int block_num)
Picture current_picture
copy of the current picture structure.
int profile
Sequence header data for all Profiles TODO: choose between ints, uint8_ts and monobit flags...
void(* vc1_h_loop_filter8)(uint8_t *src, int stride, int pq)
uint8_t * over_flags_plane
Overflags bitplane.
#define AV_CODEC_FLAG_GRAY
Only decode/encode grayscale.
static av_always_inline void vc1_i_v_loop_filter(VC1Context *v, uint8_t *dest, uint32_t flags, uint8_t fieldtx, int block_num)
void ff_vc1_i_loop_filter(VC1Context *v)
in the bitstream is reported as 11b
void ff_vc1_p_overlap_filter(VC1Context *v)
int flags
AV_CODEC_FLAG_*.
void(* vc1_v_loop_filter16)(uint8_t *src, int stride, int pq)
static av_always_inline void vc1_v_overlap_filter(VC1Context *v, int16_t(*top_block)[64], int16_t(*bottom_block)[64], int block_num)
int16_t(*[2] motion_val)[2]
static av_always_inline void vc1_p_h_intfr_loop_filter(VC1Context *v, uint8_t *dest, int *ttblk, uint32_t flags, uint8_t fieldtx, int block_num)
void ff_vc1_p_loop_filter(VC1Context *v)
int block_index[6]
index to current MB in block based arrays with edges
static const int8_t mv[256][2]
int first_slice_line
used in MPEG-4 too to handle resync markers
void(* vc1_h_loop_filter4)(uint8_t *src, int stride, int pq)
Libavcodec external API header.
ptrdiff_t linesize
line size, in bytes, may be different from width
ptrdiff_t uvlinesize
line size, for chroma in bytes, may be different from width
#define flags(name, subs,...)
void ff_vc1_b_intfi_loop_filter(VC1Context *v)
int b8_stride
2*mb_width+1 used for some 8x8 block arrays to allow simple addressing
static av_always_inline void vc1_b_h_intfi_loop_filter(VC1Context *v, uint8_t *dest, uint32_t *cbp, int *ttblk, uint32_t flags, int block_num)
in the bitstream is reported as 10b
struct AVCodecContext * avctx
int mb_stride
mb_width+1 used for some arrays to allow simple addressing of left & top MBs without sig11 ...
enum FrameCodingMode fcm
Frame decoding info for Advanced profile.
int * ttblk
Transform type at the block level.
void(* vc1_v_s_overlap)(int16_t *top, int16_t *bottom)
#define xf(width, name, var, range_min, range_max, subs,...)
void ff_vc1_i_overlap_filter(VC1Context *v)
void ff_vc1_p_intfr_loop_filter(VC1Context *v)
void(* vc1_h_loop_filter16)(uint8_t *src, int stride, int pq)