40 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
41 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
42 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
43 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
44 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
45 0, 0, 0, 0, 0, 0, 4, 4, 5, 6,
46 7, 8, 9, 10, 12, 13, 15, 17, 20, 22,
47 25, 28, 32, 36, 40, 45, 50, 56, 63, 71,
48 80, 90,101,113,127,144,162,182,203,226,
50 255,255,255,255,255,255,255,255,255,255,255,255,255,
51 255,255,255,255,255,255,255,255,255,255,255,255,255,
52 255,255,255,255,255,255,255,255,255,255,255,255,255,
53 255,255,255,255,255,255,255,255,255,255,255,255,255,
56 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
57 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
58 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
59 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
60 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
61 0, 0, 0, 0, 0, 0, 2, 2, 2, 3,
62 3, 3, 3, 4, 4, 4, 6, 6, 7, 7,
63 8, 8, 9, 9, 10, 10, 11, 11, 12, 12,
64 13, 13, 14, 14, 15, 15, 16, 16, 17, 17,
66 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
67 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
68 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
69 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
72 {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
73 {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
74 {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
75 {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
76 {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
77 {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
78 {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
79 {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
80 {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
81 {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
82 {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
83 {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 1 },
84 {-1, 0, 0, 1 }, {-1, 0, 0, 1 }, {-1, 0, 0, 1 }, {-1, 0, 1, 1 }, {-1, 0, 1, 1 }, {-1, 1, 1, 1 },
85 {-1, 1, 1, 1 }, {-1, 1, 1, 1 }, {-1, 1, 1, 1 }, {-1, 1, 1, 2 }, {-1, 1, 1, 2 }, {-1, 1, 1, 2 },
86 {-1, 1, 1, 2 }, {-1, 1, 2, 3 }, {-1, 1, 2, 3 }, {-1, 2, 2, 3 }, {-1, 2, 2, 4 }, {-1, 2, 3, 4 },
87 {-1, 2, 3, 4 }, {-1, 3, 3, 5 }, {-1, 3, 4, 6 }, {-1, 3, 4, 6 }, {-1, 4, 5, 7 }, {-1, 4, 5, 8 },
88 {-1, 4, 6, 9 }, {-1, 5, 7,10 }, {-1, 6, 8,11 }, {-1, 6, 8,13 }, {-1, 7,10,14 }, {-1, 8,11,16 },
89 {-1, 9,12,18 }, {-1,10,13,20 }, {-1,11,15,23 }, {-1,13,17,25 },
90 {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 },
91 {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 },
92 {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 },
93 {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 },
94 {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 },
95 {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 },
96 {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 },
97 {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 },
98 {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 }, {-1,13,17,25 },
104 unsigned int qp,
int a,
int b,
107 const unsigned int index_a = qp +
a;
110 if (alpha ==0 || beta == 0)
return;
112 if( bS[0] < 4 || !intra ) {
126 unsigned int qp,
int a,
int b,
129 const unsigned int index_a = qp +
a;
132 if (alpha ==0 || beta == 0)
return;
134 if( bS[0] < 4 || !intra ) {
148 const int16_t bS[7],
int bsi,
149 int qp,
int a,
int b,
152 const unsigned int index_a = qp +
a;
155 if (alpha ==0 || beta == 0)
return;
157 if( bS[0] < 4 || !intra ) {
172 int bsi,
int qp,
int a,
175 const unsigned int index_a = qp +
a;
178 if (alpha ==0 || beta == 0)
return;
180 if( bS[0] < 4 || !intra ) {
182 tc[0] =
tc0_table[index_a][bS[0*bsi]] + 1;
183 tc[1] =
tc0_table[index_a][bS[1*bsi]] + 1;
184 tc[2] =
tc0_table[index_a][bS[2*bsi]] + 1;
185 tc[3] =
tc0_table[index_a][bS[3*bsi]] + 1;
194 unsigned int qp,
int a,
int b,
197 const unsigned int index_a = qp +
a;
200 if (alpha ==0 || beta == 0)
return;
202 if( bS[0] < 4 || !intra ) {
216 unsigned int qp,
int a,
int b,
219 const unsigned int index_a = qp +
a;
222 if (alpha ==0 || beta == 0)
return;
224 if( bS[0] < 4 || !intra ) {
242 unsigned int linesize,
243 unsigned int uvlinesize,
250 int mb_xy = sl->
mb_xy;
265 qp0 = (qp + qp0 + 1) >> 1;
266 qp1 = (qp + qp1 + 1) >> 1;
267 qpc0 = (qpc + qpc0 + 1) >> 1;
268 qpc1 = (qpc + qpc1 + 1) >> 1;
271 static const int16_t bS4[4] = {4,4,4,4};
272 static const int16_t bS3[4] = {3,3,3,3};
275 filter_mb_edgev( &img_y[4*0<<pixel_shift], linesize, bS4, qp0, a, b, h, 1);
277 filter_mb_edgev( &img_y[4*2<<pixel_shift], linesize, bS3, qp, a, b, h, 0);
279 filter_mb_edgeh( &img_y[4*0*linesize], linesize, bSH, qp1, a, b, h, 1);
283 filter_mb_edgev( &img_y[4*1<<pixel_shift], linesize, bS3, qp, a, b, h, 0);
284 filter_mb_edgev( &img_y[4*2<<pixel_shift], linesize, bS3, qp, a, b, h, 0);
285 filter_mb_edgev( &img_y[4*3<<pixel_shift], linesize, bS3, qp, a, b, h, 0);
287 filter_mb_edgeh( &img_y[4*0*linesize], linesize, bSH, qp1, a, b, h, 1);
296 filter_mb_edgev( &img_cb[4*0<<pixel_shift], linesize, bS4, qpc0, a, b, h, 1);
297 filter_mb_edgev( &img_cr[4*0<<pixel_shift], linesize, bS4, qpc0, a, b, h, 1);
300 filter_mb_edgev( &img_cb[4*2<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);
301 filter_mb_edgev( &img_cr[4*2<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);
303 filter_mb_edgeh( &img_cb[4*0*linesize], linesize, bSH, qpc1, a, b, h, 1 );
304 filter_mb_edgeh( &img_cr[4*0*linesize], linesize, bSH, qpc1, a, b, h, 1 );
306 filter_mb_edgeh( &img_cb[4*2*linesize], linesize, bS3, qpc, a, b, h, 0);
307 filter_mb_edgeh( &img_cr[4*2*linesize], linesize, bS3, qpc, a, b, h, 0);
309 filter_mb_edgev( &img_cb[4*1<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);
310 filter_mb_edgev( &img_cr[4*1<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);
311 filter_mb_edgev( &img_cb[4*2<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);
312 filter_mb_edgev( &img_cr[4*2<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);
313 filter_mb_edgev( &img_cb[4*3<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);
314 filter_mb_edgev( &img_cr[4*3<<pixel_shift], linesize, bS3, qpc, a, b, h, 0);
316 filter_mb_edgeh( &img_cb[4*0*linesize], linesize, bSH, qpc1, a, b, h, 1);
317 filter_mb_edgeh( &img_cr[4*0*linesize], linesize, bSH, qpc1, a, b, h, 1);
319 filter_mb_edgeh( &img_cb[4*1*linesize], linesize, bS3, qpc, a, b, h, 0);
320 filter_mb_edgeh( &img_cr[4*1*linesize], linesize, bS3, qpc, a, b, h, 0);
321 filter_mb_edgeh( &img_cb[4*2*linesize], linesize, bS3, qpc, a, b, h, 0);
322 filter_mb_edgeh( &img_cr[4*2*linesize], linesize, bS3, qpc, a, b, h, 0);
323 filter_mb_edgeh( &img_cb[4*3*linesize], linesize, bS3, qpc, a, b, h, 0);
324 filter_mb_edgeh( &img_cr[4*3*linesize], linesize, bS3, qpc, a, b, h, 0);
328 filter_mb_edgecv(&img_cb[2*0<<pixel_shift], uvlinesize, bS4, qpc0, a, b, h, 1);
329 filter_mb_edgecv(&img_cr[2*0<<pixel_shift], uvlinesize, bS4, qpc0, a, b, h, 1);
331 filter_mb_edgecv(&img_cb[2*2<<pixel_shift], uvlinesize, bS3, qpc, a, b, h, 0);
332 filter_mb_edgecv(&img_cr[2*2<<pixel_shift], uvlinesize, bS3, qpc, a, b, h, 0);
334 filter_mb_edgech(&img_cb[4*0*uvlinesize], uvlinesize, bSH, qpc1, a, b, h, 1);
335 filter_mb_edgech(&img_cr[4*0*uvlinesize], uvlinesize, bSH, qpc1, a, b, h, 1);
337 filter_mb_edgech(&img_cb[4*1*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);
338 filter_mb_edgech(&img_cr[4*1*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);
339 filter_mb_edgech(&img_cb[4*2*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);
340 filter_mb_edgech(&img_cr[4*2*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);
341 filter_mb_edgech(&img_cb[4*3*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);
342 filter_mb_edgech(&img_cr[4*3*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);
345 filter_mb_edgecv( &img_cb[2*0<<pixel_shift], uvlinesize, bS4, qpc0, a, b, h, 1);
346 filter_mb_edgecv( &img_cr[2*0<<pixel_shift], uvlinesize, bS4, qpc0, a, b, h, 1);
348 filter_mb_edgecv( &img_cb[2*2<<pixel_shift], uvlinesize, bS3, qpc, a, b, h, 0);
349 filter_mb_edgecv( &img_cr[2*2<<pixel_shift], uvlinesize, bS3, qpc, a, b, h, 0);
351 filter_mb_edgech( &img_cb[2*0*uvlinesize], uvlinesize, bSH, qpc1, a, b, h, 1);
352 filter_mb_edgech( &img_cr[2*0*uvlinesize], uvlinesize, bSH, qpc1, a, b, h, 1);
354 filter_mb_edgech( &img_cb[2*2*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);
355 filter_mb_edgech( &img_cr[2*2*uvlinesize], uvlinesize, bS3, qpc, a, b, h, 0);
362 if(
IS_8x8DCT(mb_type) && (sl->
cbp&7) == 7 && !chroma444 ) {
364 AV_WN64A(bS[0][0], 0x0002000200020002ULL);
365 AV_WN64A(bS[0][2], 0x0002000200020002ULL);
366 AV_WN64A(bS[1][0], 0x0002000200020002ULL);
367 AV_WN64A(bS[1][2], 0x0002000200020002ULL);
369 int mask_edge1 = (3*(((5*mb_type)>>5)&1)) | (mb_type>>4);
370 int mask_edge0 = 3*((mask_edge1>>1) & ((5*left_type)>>5)&1);
371 int step = 1+(mb_type>>24);
372 edges = 4 - 3*((mb_type>>3) & !(sl->
cbp & 15));
377 AV_WN64A(bS[0][0], 0x0004000400040004ULL);
381 #define FILTER(hv,dir,edge,intra)\
382 if(AV_RN64A(bS[dir][edge])) { \
383 filter_mb_edge##hv( &img_y[4*edge*(dir?linesize:1<<pixel_shift)], linesize, bS[dir][edge], edge ? qp : qp##dir, a, b, h, intra );\
386 filter_mb_edge##hv( &img_cb[4*edge*(dir?linesize:1<<pixel_shift)], linesize, bS[dir][edge], edge ? qpc : qpc##dir, a, b, h, intra );\
387 filter_mb_edge##hv( &img_cr[4*edge*(dir?linesize:1<<pixel_shift)], linesize, bS[dir][edge], edge ? qpc : qpc##dir, a, b, h, intra );\
388 } else if(!(edge&1)) {\
389 filter_mb_edgec##hv( &img_cb[2*edge*(dir?uvlinesize:1<<pixel_shift)], uvlinesize, bS[dir][edge], edge ? qpc : qpc##dir, a, b, h, intra );\
390 filter_mb_edgec##hv( &img_cr[2*edge*(dir?uvlinesize:1<<pixel_shift)], uvlinesize, bS[dir][edge], edge ? qpc : qpc##dir, a, b, h, intra );\
419 int mb_x,
int mb_y,
uint8_t *img_y,
421 unsigned int linesize,
unsigned int uvlinesize)
425 ff_h264_filter_mb(h, sl, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize);
473 unsigned int linesize,
unsigned int uvlinesize,
474 int mb_xy,
int mb_type,
int mvy_limit,
475 int first_vertical_edge_done,
int a,
int b,
479 int chroma_qp_avg[2];
482 const int mbm_xy = dir == 0 ? mb_xy -1 : sl->
top_mb_xy;
486 static const uint8_t mask_edge_tab[2][8]={{0,3,3,3,1,1,1,1},
488 const int mask_edge = mask_edge_tab[dir][(mb_type>>3)&7];
489 const int edges = mask_edge== 3 && !(sl->
cbp&15) ? 1 : 4;
494 if(mbm_type && !first_vertical_edge_done){
496 if (
FRAME_MBAFF(h) && (dir == 1) && ((mb_y&1) == 0)
503 unsigned int tmp_linesize = 2 * linesize;
504 unsigned int tmp_uvlinesize = 2 * uvlinesize;
508 for(j=0; j<2; j++, mbn_xy += h->
mb_stride){
512 AV_WN64A(bS, 0x0003000300030003ULL);
522 for( i = 0; i < 4; i++ ) {
530 ff_tlog(h->
avctx,
"filter mb:%d/%d dir:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, qp, tmp_linesize, tmp_uvlinesize);
532 filter_mb_edgeh( &img_y[j*linesize], tmp_linesize, bS, qp, a, b, h, 0 );
537 filter_mb_edgeh (&img_cb[j*uvlinesize], tmp_uvlinesize, bS, chroma_qp_avg[0], a, b, h, 0);
538 filter_mb_edgeh (&img_cr[j*uvlinesize], tmp_uvlinesize, bS, chroma_qp_avg[1], a, b, h, 0);
540 filter_mb_edgech(&img_cb[j*uvlinesize], tmp_uvlinesize, bS, chroma_qp_avg[0], a, b, h, 0);
541 filter_mb_edgech(&img_cr[j*uvlinesize], tmp_uvlinesize, bS, chroma_qp_avg[1], a, b, h, 0);
550 AV_WN64A(bS, 0x0003000300030003ULL);
554 AV_WN64A(bS, 0x0004000400040004ULL);
560 AV_WN64A(bS, 0x0001000100010001ULL);
565 int bn_idx= b_idx - (dir ? 8:1);
567 bS[0] = bS[1] = bS[2] = bS[3] =
check_mv(sl, 8 + 4, bn_idx, mvy_limit);
573 for( i = 0; i < 4; i++ ) {
574 int x = dir == 0 ? 0 : i;
575 int y = dir == 0 ? i : 0;
576 int b_idx= 8 + 4 + x + 8*y;
577 int bn_idx= b_idx - (dir ? 8:1);
585 bS[i] =
check_mv(sl, b_idx, bn_idx, mvy_limit);
593 if(bS[0]+bS[1]+bS[2]+bS[3]){
596 ff_tlog(h->
avctx,
"filter mb:%d/%d dir:%d edge:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, edge, qp, linesize, uvlinesize);
604 filter_mb_edgev ( &img_cb[0], uvlinesize, bS, chroma_qp_avg[0], a, b, h, 1);
605 filter_mb_edgev ( &img_cr[0], uvlinesize, bS, chroma_qp_avg[1], a, b, h, 1);
607 filter_mb_edgecv( &img_cb[0], uvlinesize, bS, chroma_qp_avg[0], a, b, h, 1);
608 filter_mb_edgecv( &img_cr[0], uvlinesize, bS, chroma_qp_avg[1], a, b, h, 1);
615 filter_mb_edgeh ( &img_cb[0], uvlinesize, bS, chroma_qp_avg[0], a, b, h, 1);
616 filter_mb_edgeh ( &img_cr[0], uvlinesize, bS, chroma_qp_avg[1], a, b, h, 1);
618 filter_mb_edgech( &img_cb[0], uvlinesize, bS, chroma_qp_avg[0], a, b, h, 1);
619 filter_mb_edgech( &img_cr[0], uvlinesize, bS, chroma_qp_avg[1], a, b, h, 1);
628 for( edge = 1; edge < edges; edge++ ) {
631 const int deblock_edge = !
IS_8x8DCT(mb_type & (edge<<24));
633 if (!deblock_edge && (!chroma422 || dir == 0))
637 AV_WN64A(bS, 0x0003000300030003ULL);
642 if( edge & mask_edge ) {
646 else if( mask_par0 ) {
647 int b_idx= 8 + 4 + edge * (dir ? 8:1);
648 int bn_idx= b_idx - (dir ? 8:1);
650 bS[0] = bS[1] = bS[2] = bS[3] =
check_mv(sl, b_idx, bn_idx, mvy_limit);
656 for( i = 0; i < 4; i++ ) {
657 int x = dir == 0 ? edge : i;
658 int y = dir == 0 ? i : edge;
659 int b_idx= 8 + 4 + x + 8*y;
660 int bn_idx= b_idx - (dir ? 8:1);
668 bS[i] =
check_mv(sl, b_idx, bn_idx, mvy_limit);
672 if(bS[0]+bS[1]+bS[2]+bS[3] == 0)
681 ff_tlog(h->
avctx,
"filter mb:%d/%d dir:%d edge:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, edge, qp, linesize, uvlinesize);
689 }
else if( (edge&1) == 0 ) {
697 filter_mb_edgeh(&img_y[4*edge*linesize], linesize, bS, qp, a, b, h, 0);
703 filter_mb_edgeh(&img_y[4*edge*linesize], linesize, bS, qp, a, b, h, 0);
708 }
else if ((edge&1) == 0) {
721 unsigned int linesize,
unsigned int uvlinesize)
723 const int mb_xy= mb_x + mb_y*h->
mb_stride;
726 int first_vertical_edge_done = 0;
744 int mb_qp, mbn0_qp, mbn1_qp;
746 first_vertical_edge_done = 1;
749 AV_WN64A(&bS[0], 0x0004000400040004ULL);
750 AV_WN64A(&bS[4], 0x0004000400040004ULL);
754 {3+4*0, 3+4*0, 3+4*0, 3+4*0, 3+4*1, 3+4*1, 3+4*1, 3+4*1},
755 {3+4*2, 3+4*2, 3+4*2, 3+4*2, 3+4*3, 3+4*3, 3+4*3, 3+4*3},
757 {3+4*0, 3+4*1, 3+4*2, 3+4*3, 3+4*0, 3+4*1, 3+4*2, 3+4*3},
758 {3+4*0, 3+4*1, 3+4*2, 3+4*3, 3+4*0, 3+4*1, 3+4*2, 3+4*3},
762 for( i = 0; i < 8; i++ ) {
782 qp[0] = ( mb_qp + mbn0_qp + 1 ) >> 1;
787 qp[1] = ( mb_qp + mbn1_qp + 1 ) >> 1;
794 ff_tlog(h->
avctx,
"filter mb:%d/%d MBAFF, QPy:%d/%d, QPb:%d/%d QPr:%d/%d ls:%d uvls:%d", mb_x, mb_y, qp[0], qp[1], bqp[0], bqp[1], rqp[0], rqp[1], linesize, uvlinesize);
839 for (dir = 0; dir < 2; dir++)
840 filter_mb_dir(h, sl, mb_x, mb_y, img_y, img_cb, img_cr, linesize,
841 uvlinesize, mb_xy, mb_type, mvy_limit,
842 dir ? 0 : first_vertical_edge_done, a, b,
846 filter_mb_dir(h, sl, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, mb_xy, mb_type, mvy_limit, first_vertical_edge_done, a, b, chroma, 0);
847 filter_mb_dir(h, sl, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, mb_xy, mb_type, mvy_limit, 0, a, b, chroma, 1);
static float alpha(float a)
static int check_mv(H264SliceContext *sl, long b_idx, long bn_idx, int mvy_limit)
int16_t mv_cache[2][5 *8][2]
Motion vector cache.
static av_always_inline int get_chroma_qp(const PPS *pps, int t, int qscale)
Get the chroma qp.
void(* h264_v_loop_filter_luma_intra)(uint8_t *pix, int stride, int alpha, int beta)
static const uint8_t alpha_table[52 *3]
void(* h264_h_loop_filter_luma_mbaff_intra)(uint8_t *pix, int stride, int alpha, int beta)
void(* h264_h_loop_filter_chroma_mbaff)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
void(* h264_h_loop_filter_chroma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
int slice_alpha_c0_offset
void(* h264_h_loop_filter_luma_mbaff)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
int cabac
entropy_coding_mode_flag
static av_always_inline void filter_mb_edgech(uint8_t *pix, int stride, const int16_t bS[4], unsigned int qp, int a, int b, const H264Context *h, int intra)
static av_always_inline void filter_mb_dir(const H264Context *h, H264SliceContext *sl, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize, int mb_xy, int mb_type, int mvy_limit, int first_vertical_edge_done, int a, int b, int chroma, int dir)
void ff_h264_filter_mb(const H264Context *h, H264SliceContext *sl, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize)
#define AV_CODEC_FLAG_GRAY
Only decode/encode grayscale.
void(* h264_h_loop_filter_chroma_intra)(uint8_t *pix, int stride, int alpha, int beta)
void(* h264_v_loop_filter_chroma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
H.264 parameter set handling.
static const uint8_t offset[127][2]
common internal API header
useful rectangle filling function
void(* h264_v_loop_filter_chroma_intra)(uint8_t *pix, int stride, int alpha, int beta)
static av_always_inline void filter_mb_edgeh(uint8_t *pix, int stride, const int16_t bS[4], unsigned int qp, int a, int b, const H264Context *h, int intra)
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
H.264 / AVC / MPEG-4 part10 codec.
static av_always_inline void filter_mb_edgecv(uint8_t *pix, int stride, const int16_t bS[4], unsigned int qp, int a, int b, const H264Context *h, int intra)
static av_always_inline void filter_mb_mbaff_edgev(const H264Context *h, uint8_t *pix, int stride, const int16_t bS[7], int bsi, int qp, int a, int b, int intra)
Libavcodec external API header.
static av_always_inline void h264_filter_mb_fast_internal(const H264Context *h, H264SliceContext *sl, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize, int pixel_shift)
void(* h264_v_loop_filter_luma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
static const uint8_t scan8[16 *3+3]
static const uint8_t tc0_table[52 *3][4]
uint8_t non_zero_count_cache[15 *8]
non zero coeff count cache.
int pixel_shift
0 for 8-bit H.264, 1 for high-bit-depth H.264
void(* h264_h_loop_filter_chroma_mbaff_intra)(uint8_t *pix, int stride, int alpha, int beta)
static av_always_inline void filter_mb_edgev(uint8_t *pix, int stride, const int16_t bS[4], unsigned int qp, int a, int b, const H264Context *h, int intra)
GLint GLenum GLboolean GLsizei stride
common internal api header.
void(* h264_h_loop_filter_luma_intra)(uint8_t *pix, int stride, int alpha, int beta)
#define LOCAL_ALIGNED(a, t, v,...)
#define FILTER(hv, dir, edge, intra)
int bit_depth_luma
bit_depth_luma_minus8 + 8
void(* h264_loop_filter_strength)(int16_t bS[2][4][4], uint8_t nnz[40], int8_t ref[2][40], int16_t mv[2][40][2], int bidir, int edges, int step, int mask_mv0, int mask_mv1, int field)
int8_t ref_cache[2][5 *8]
void(* h264_h_loop_filter_luma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
static av_always_inline void filter_mb_mbaff_edgecv(const H264Context *h, uint8_t *pix, int stride, const int16_t bS[7], int bsi, int qp, int a, int b, int intra)
uint8_t(* non_zero_count)[48]
static const uint8_t beta_table[52 *3]
void ff_h264_filter_mb_fast(const H264Context *h, H264SliceContext *sl, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize)