Libav
h264_mb.c
Go to the documentation of this file.
1 /*
2  * H.26L/H.264/AVC/JVT/14496-10/... decoder
3  * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
4  *
5  * This file is part of Libav.
6  *
7  * Libav is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * Libav is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with Libav; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
27 #include <stdint.h>
28 
29 #include "config.h"
30 
31 #include "libavutil/common.h"
32 #include "libavutil/intreadwrite.h"
33 #include "avcodec.h"
34 #include "h264.h"
35 #include "qpeldsp.h"
36 #include "svq3.h"
37 #include "thread.h"
38 
39 static inline int get_lowest_part_list_y(H264Context *h, H264Picture *pic, int n,
40  int height, int y_offset, int list)
41 {
42  int raw_my = h->mv_cache[list][scan8[n]][1];
43  int filter_height_up = (raw_my & 3) ? 2 : 0;
44  int filter_height_down = (raw_my & 3) ? 3 : 0;
45  int full_my = (raw_my >> 2) + y_offset;
46  int top = full_my - filter_height_up;
47  int bottom = full_my + filter_height_down + height;
48 
49  return FFMAX(abs(top), bottom);
50 }
51 
52 static inline void get_lowest_part_y(H264Context *h, int refs[2][48], int n,
53  int height, int y_offset, int list0,
54  int list1, int *nrefs)
55 {
56  int my;
57 
58  y_offset += 16 * (h->mb_y >> MB_FIELD(h));
59 
60  if (list0) {
61  int ref_n = h->ref_cache[0][scan8[n]];
62  H264Picture *ref = &h->ref_list[0][ref_n];
63 
64  // Error resilience puts the current picture in the ref list.
65  // Don't try to wait on these as it will cause a deadlock.
66  // Fields can wait on each other, though.
67  if (ref->tf.progress->data != h->cur_pic.tf.progress->data ||
68  (ref->reference & 3) != h->picture_structure) {
69  my = get_lowest_part_list_y(h, ref, n, height, y_offset, 0);
70  if (refs[0][ref_n] < 0)
71  nrefs[0] += 1;
72  refs[0][ref_n] = FFMAX(refs[0][ref_n], my);
73  }
74  }
75 
76  if (list1) {
77  int ref_n = h->ref_cache[1][scan8[n]];
78  H264Picture *ref = &h->ref_list[1][ref_n];
79 
80  if (ref->tf.progress->data != h->cur_pic.tf.progress->data ||
81  (ref->reference & 3) != h->picture_structure) {
82  my = get_lowest_part_list_y(h, ref, n, height, y_offset, 1);
83  if (refs[1][ref_n] < 0)
84  nrefs[1] += 1;
85  refs[1][ref_n] = FFMAX(refs[1][ref_n], my);
86  }
87  }
88 }
89 
96 {
97  const int mb_xy = h->mb_xy;
98  const int mb_type = h->cur_pic.mb_type[mb_xy];
99  int refs[2][48];
100  int nrefs[2] = { 0 };
101  int ref, list;
102 
103  memset(refs, -1, sizeof(refs));
104 
105  if (IS_16X16(mb_type)) {
106  get_lowest_part_y(h, refs, 0, 16, 0,
107  IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs);
108  } else if (IS_16X8(mb_type)) {
109  get_lowest_part_y(h, refs, 0, 8, 0,
110  IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs);
111  get_lowest_part_y(h, refs, 8, 8, 8,
112  IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1), nrefs);
113  } else if (IS_8X16(mb_type)) {
114  get_lowest_part_y(h, refs, 0, 16, 0,
115  IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs);
116  get_lowest_part_y(h, refs, 4, 16, 0,
117  IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1), nrefs);
118  } else {
119  int i;
120 
121  assert(IS_8X8(mb_type));
122 
123  for (i = 0; i < 4; i++) {
124  const int sub_mb_type = h->sub_mb_type[i];
125  const int n = 4 * i;
126  int y_offset = (i & 2) << 2;
127 
128  if (IS_SUB_8X8(sub_mb_type)) {
129  get_lowest_part_y(h, refs, n, 8, y_offset,
130  IS_DIR(sub_mb_type, 0, 0),
131  IS_DIR(sub_mb_type, 0, 1),
132  nrefs);
133  } else if (IS_SUB_8X4(sub_mb_type)) {
134  get_lowest_part_y(h, refs, n, 4, y_offset,
135  IS_DIR(sub_mb_type, 0, 0),
136  IS_DIR(sub_mb_type, 0, 1),
137  nrefs);
138  get_lowest_part_y(h, refs, n + 2, 4, y_offset + 4,
139  IS_DIR(sub_mb_type, 0, 0),
140  IS_DIR(sub_mb_type, 0, 1),
141  nrefs);
142  } else if (IS_SUB_4X8(sub_mb_type)) {
143  get_lowest_part_y(h, refs, n, 8, y_offset,
144  IS_DIR(sub_mb_type, 0, 0),
145  IS_DIR(sub_mb_type, 0, 1),
146  nrefs);
147  get_lowest_part_y(h, refs, n + 1, 8, y_offset,
148  IS_DIR(sub_mb_type, 0, 0),
149  IS_DIR(sub_mb_type, 0, 1),
150  nrefs);
151  } else {
152  int j;
153  assert(IS_SUB_4X4(sub_mb_type));
154  for (j = 0; j < 4; j++) {
155  int sub_y_offset = y_offset + 2 * (j & 2);
156  get_lowest_part_y(h, refs, n + j, 4, sub_y_offset,
157  IS_DIR(sub_mb_type, 0, 0),
158  IS_DIR(sub_mb_type, 0, 1),
159  nrefs);
160  }
161  }
162  }
163  }
164 
165  for (list = h->list_count - 1; list >= 0; list--)
166  for (ref = 0; ref < 48 && nrefs[list]; ref++) {
167  int row = refs[list][ref];
168  if (row >= 0) {
169  H264Picture *ref_pic = &h->ref_list[list][ref];
170  int ref_field = ref_pic->reference - 1;
171  int ref_field_picture = ref_pic->field_picture;
172  int pic_height = 16 * h->mb_height >> ref_field_picture;
173 
174  row <<= MB_MBAFF(h);
175  nrefs[list]--;
176 
177  if (!FIELD_PICTURE(h) && ref_field_picture) { // frame referencing two fields
178  ff_thread_await_progress(&ref_pic->tf,
179  FFMIN((row >> 1) - !(row & 1),
180  pic_height - 1),
181  1);
182  ff_thread_await_progress(&ref_pic->tf,
183  FFMIN((row >> 1), pic_height - 1),
184  0);
185  } else if (FIELD_PICTURE(h) && !ref_field_picture) { // field referencing one field of a frame
186  ff_thread_await_progress(&ref_pic->tf,
187  FFMIN(row * 2 + ref_field,
188  pic_height - 1),
189  0);
190  } else if (FIELD_PICTURE(h)) {
191  ff_thread_await_progress(&ref_pic->tf,
192  FFMIN(row, pic_height - 1),
193  ref_field);
194  } else {
195  ff_thread_await_progress(&ref_pic->tf,
196  FFMIN(row, pic_height - 1),
197  0);
198  }
199  }
200  }
201 }
202 
204  int n, int square, int height,
205  int delta, int list,
206  uint8_t *dest_y, uint8_t *dest_cb,
207  uint8_t *dest_cr,
208  int src_x_offset, int src_y_offset,
209  qpel_mc_func *qpix_op,
210  h264_chroma_mc_func chroma_op,
211  int pixel_shift, int chroma_idc)
212 {
213  const int mx = h->mv_cache[list][scan8[n]][0] + src_x_offset * 8;
214  int my = h->mv_cache[list][scan8[n]][1] + src_y_offset * 8;
215  const int luma_xy = (mx & 3) + ((my & 3) << 2);
216  ptrdiff_t offset = ((mx >> 2) << pixel_shift) + (my >> 2) * h->mb_linesize;
217  uint8_t *src_y = pic->f.data[0] + offset;
218  uint8_t *src_cb, *src_cr;
219  int extra_width = 0;
220  int extra_height = 0;
221  int emu = 0;
222  const int full_mx = mx >> 2;
223  const int full_my = my >> 2;
224  const int pic_width = 16 * h->mb_width;
225  const int pic_height = 16 * h->mb_height >> MB_FIELD(h);
226  int ysh;
227 
228  if (mx & 7)
229  extra_width -= 3;
230  if (my & 7)
231  extra_height -= 3;
232 
233  if (full_mx < 0 - extra_width ||
234  full_my < 0 - extra_height ||
235  full_mx + 16 /*FIXME*/ > pic_width + extra_width ||
236  full_my + 16 /*FIXME*/ > pic_height + extra_height) {
238  src_y - (2 << pixel_shift) - 2 * h->mb_linesize,
239  h->mb_linesize, h->mb_linesize,
240  16 + 5, 16 + 5 /*FIXME*/, full_mx - 2,
241  full_my - 2, pic_width, pic_height);
242  src_y = h->edge_emu_buffer + (2 << pixel_shift) + 2 * h->mb_linesize;
243  emu = 1;
244  }
245 
246  qpix_op[luma_xy](dest_y, src_y, h->mb_linesize); // FIXME try variable height perhaps?
247  if (!square)
248  qpix_op[luma_xy](dest_y + delta, src_y + delta, h->mb_linesize);
249 
250  if (CONFIG_GRAY && h->flags & CODEC_FLAG_GRAY)
251  return;
252 
253  if (chroma_idc == 3 /* yuv444 */) {
254  src_cb = pic->f.data[1] + offset;
255  if (emu) {
257  src_cb - (2 << pixel_shift) - 2 * h->mb_linesize,
258  h->mb_linesize, h->mb_linesize,
259  16 + 5, 16 + 5 /*FIXME*/,
260  full_mx - 2, full_my - 2,
261  pic_width, pic_height);
262  src_cb = h->edge_emu_buffer + (2 << pixel_shift) + 2 * h->mb_linesize;
263  }
264  qpix_op[luma_xy](dest_cb, src_cb, h->mb_linesize); // FIXME try variable height perhaps?
265  if (!square)
266  qpix_op[luma_xy](dest_cb + delta, src_cb + delta, h->mb_linesize);
267 
268  src_cr = pic->f.data[2] + offset;
269  if (emu) {
271  src_cr - (2 << pixel_shift) - 2 * h->mb_linesize,
272  h->mb_linesize, h->mb_linesize,
273  16 + 5, 16 + 5 /*FIXME*/,
274  full_mx - 2, full_my - 2,
275  pic_width, pic_height);
276  src_cr = h->edge_emu_buffer + (2 << pixel_shift) + 2 * h->mb_linesize;
277  }
278  qpix_op[luma_xy](dest_cr, src_cr, h->mb_linesize); // FIXME try variable height perhaps?
279  if (!square)
280  qpix_op[luma_xy](dest_cr + delta, src_cr + delta, h->mb_linesize);
281  return;
282  }
283 
284  ysh = 3 - (chroma_idc == 2 /* yuv422 */);
285  if (chroma_idc == 1 /* yuv420 */ && MB_FIELD(h)) {
286  // chroma offset when predicting from a field of opposite parity
287  my += 2 * ((h->mb_y & 1) - (pic->reference - 1));
288  emu |= (my >> 3) < 0 || (my >> 3) + 8 >= (pic_height >> 1);
289  }
290 
291  src_cb = pic->f.data[1] + ((mx >> 3) << pixel_shift) +
292  (my >> ysh) * h->mb_uvlinesize;
293  src_cr = pic->f.data[2] + ((mx >> 3) << pixel_shift) +
294  (my >> ysh) * h->mb_uvlinesize;
295 
296  if (emu) {
297  h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src_cb,
299  9, 8 * chroma_idc + 1, (mx >> 3), (my >> ysh),
300  pic_width >> 1, pic_height >> (chroma_idc == 1 /* yuv420 */));
301  src_cb = h->edge_emu_buffer;
302  }
303  chroma_op(dest_cb, src_cb, h->mb_uvlinesize,
304  height >> (chroma_idc == 1 /* yuv420 */),
305  mx & 7, (my << (chroma_idc == 2 /* yuv422 */)) & 7);
306 
307  if (emu) {
308  h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src_cr,
310  9, 8 * chroma_idc + 1, (mx >> 3), (my >> ysh),
311  pic_width >> 1, pic_height >> (chroma_idc == 1 /* yuv420 */));
312  src_cr = h->edge_emu_buffer;
313  }
314  chroma_op(dest_cr, src_cr, h->mb_uvlinesize, height >> (chroma_idc == 1 /* yuv420 */),
315  mx & 7, (my << (chroma_idc == 2 /* yuv422 */)) & 7);
316 }
317 
318 static av_always_inline void mc_part_std(H264Context *h, int n, int square,
319  int height, int delta,
320  uint8_t *dest_y, uint8_t *dest_cb,
321  uint8_t *dest_cr,
322  int x_offset, int y_offset,
323  qpel_mc_func *qpix_put,
324  h264_chroma_mc_func chroma_put,
325  qpel_mc_func *qpix_avg,
326  h264_chroma_mc_func chroma_avg,
327  int list0, int list1,
328  int pixel_shift, int chroma_idc)
329 {
330  qpel_mc_func *qpix_op = qpix_put;
331  h264_chroma_mc_func chroma_op = chroma_put;
332 
333  dest_y += (2 * x_offset << pixel_shift) + 2 * y_offset * h->mb_linesize;
334  if (chroma_idc == 3 /* yuv444 */) {
335  dest_cb += (2 * x_offset << pixel_shift) + 2 * y_offset * h->mb_linesize;
336  dest_cr += (2 * x_offset << pixel_shift) + 2 * y_offset * h->mb_linesize;
337  } else if (chroma_idc == 2 /* yuv422 */) {
338  dest_cb += (x_offset << pixel_shift) + 2 * y_offset * h->mb_uvlinesize;
339  dest_cr += (x_offset << pixel_shift) + 2 * y_offset * h->mb_uvlinesize;
340  } else { /* yuv420 */
341  dest_cb += (x_offset << pixel_shift) + y_offset * h->mb_uvlinesize;
342  dest_cr += (x_offset << pixel_shift) + y_offset * h->mb_uvlinesize;
343  }
344  x_offset += 8 * h->mb_x;
345  y_offset += 8 * (h->mb_y >> MB_FIELD(h));
346 
347  if (list0) {
348  H264Picture *ref = &h->ref_list[0][h->ref_cache[0][scan8[n]]];
349  mc_dir_part(h, ref, n, square, height, delta, 0,
350  dest_y, dest_cb, dest_cr, x_offset, y_offset,
351  qpix_op, chroma_op, pixel_shift, chroma_idc);
352 
353  qpix_op = qpix_avg;
354  chroma_op = chroma_avg;
355  }
356 
357  if (list1) {
358  H264Picture *ref = &h->ref_list[1][h->ref_cache[1][scan8[n]]];
359  mc_dir_part(h, ref, n, square, height, delta, 1,
360  dest_y, dest_cb, dest_cr, x_offset, y_offset,
361  qpix_op, chroma_op, pixel_shift, chroma_idc);
362  }
363 }
364 
366  int height, int delta,
367  uint8_t *dest_y, uint8_t *dest_cb,
368  uint8_t *dest_cr,
369  int x_offset, int y_offset,
370  qpel_mc_func *qpix_put,
371  h264_chroma_mc_func chroma_put,
372  h264_weight_func luma_weight_op,
373  h264_weight_func chroma_weight_op,
374  h264_biweight_func luma_weight_avg,
375  h264_biweight_func chroma_weight_avg,
376  int list0, int list1,
377  int pixel_shift, int chroma_idc)
378 {
379  int chroma_height;
380 
381  dest_y += (2 * x_offset << pixel_shift) + 2 * y_offset * h->mb_linesize;
382  if (chroma_idc == 3 /* yuv444 */) {
383  chroma_height = height;
384  chroma_weight_avg = luma_weight_avg;
385  chroma_weight_op = luma_weight_op;
386  dest_cb += (2 * x_offset << pixel_shift) + 2 * y_offset * h->mb_linesize;
387  dest_cr += (2 * x_offset << pixel_shift) + 2 * y_offset * h->mb_linesize;
388  } else if (chroma_idc == 2 /* yuv422 */) {
389  chroma_height = height;
390  dest_cb += (x_offset << pixel_shift) + 2 * y_offset * h->mb_uvlinesize;
391  dest_cr += (x_offset << pixel_shift) + 2 * y_offset * h->mb_uvlinesize;
392  } else { /* yuv420 */
393  chroma_height = height >> 1;
394  dest_cb += (x_offset << pixel_shift) + y_offset * h->mb_uvlinesize;
395  dest_cr += (x_offset << pixel_shift) + y_offset * h->mb_uvlinesize;
396  }
397  x_offset += 8 * h->mb_x;
398  y_offset += 8 * (h->mb_y >> MB_FIELD(h));
399 
400  if (list0 && list1) {
401  /* don't optimize for luma-only case, since B-frames usually
402  * use implicit weights => chroma too. */
403  uint8_t *tmp_cb = h->bipred_scratchpad;
404  uint8_t *tmp_cr = h->bipred_scratchpad + (16 << pixel_shift);
405  uint8_t *tmp_y = h->bipred_scratchpad + 16 * h->mb_uvlinesize;
406  int refn0 = h->ref_cache[0][scan8[n]];
407  int refn1 = h->ref_cache[1][scan8[n]];
408 
409  mc_dir_part(h, &h->ref_list[0][refn0], n, square, height, delta, 0,
410  dest_y, dest_cb, dest_cr,
411  x_offset, y_offset, qpix_put, chroma_put,
412  pixel_shift, chroma_idc);
413  mc_dir_part(h, &h->ref_list[1][refn1], n, square, height, delta, 1,
414  tmp_y, tmp_cb, tmp_cr,
415  x_offset, y_offset, qpix_put, chroma_put,
416  pixel_shift, chroma_idc);
417 
418  if (h->use_weight == 2) {
419  int weight0 = h->implicit_weight[refn0][refn1][h->mb_y & 1];
420  int weight1 = 64 - weight0;
421  luma_weight_avg(dest_y, tmp_y, h->mb_linesize,
422  height, 5, weight0, weight1, 0);
423  chroma_weight_avg(dest_cb, tmp_cb, h->mb_uvlinesize,
424  chroma_height, 5, weight0, weight1, 0);
425  chroma_weight_avg(dest_cr, tmp_cr, h->mb_uvlinesize,
426  chroma_height, 5, weight0, weight1, 0);
427  } else {
428  luma_weight_avg(dest_y, tmp_y, h->mb_linesize, height,
430  h->luma_weight[refn0][0][0],
431  h->luma_weight[refn1][1][0],
432  h->luma_weight[refn0][0][1] +
433  h->luma_weight[refn1][1][1]);
434  chroma_weight_avg(dest_cb, tmp_cb, h->mb_uvlinesize, chroma_height,
436  h->chroma_weight[refn0][0][0][0],
437  h->chroma_weight[refn1][1][0][0],
438  h->chroma_weight[refn0][0][0][1] +
439  h->chroma_weight[refn1][1][0][1]);
440  chroma_weight_avg(dest_cr, tmp_cr, h->mb_uvlinesize, chroma_height,
442  h->chroma_weight[refn0][0][1][0],
443  h->chroma_weight[refn1][1][1][0],
444  h->chroma_weight[refn0][0][1][1] +
445  h->chroma_weight[refn1][1][1][1]);
446  }
447  } else {
448  int list = list1 ? 1 : 0;
449  int refn = h->ref_cache[list][scan8[n]];
450  H264Picture *ref = &h->ref_list[list][refn];
451  mc_dir_part(h, ref, n, square, height, delta, list,
452  dest_y, dest_cb, dest_cr, x_offset, y_offset,
453  qpix_put, chroma_put, pixel_shift, chroma_idc);
454 
455  luma_weight_op(dest_y, h->mb_linesize, height,
457  h->luma_weight[refn][list][0],
458  h->luma_weight[refn][list][1]);
459  if (h->use_weight_chroma) {
460  chroma_weight_op(dest_cb, h->mb_uvlinesize, chroma_height,
462  h->chroma_weight[refn][list][0][0],
463  h->chroma_weight[refn][list][0][1]);
464  chroma_weight_op(dest_cr, h->mb_uvlinesize, chroma_height,
466  h->chroma_weight[refn][list][1][0],
467  h->chroma_weight[refn][list][1][1]);
468  }
469  }
470 }
471 
473  int pixel_shift, int chroma_idc)
474 {
475  /* fetch pixels for estimated mv 4 macroblocks ahead
476  * optimized for 64byte cache lines */
477  const int refn = h->ref_cache[list][scan8[0]];
478  if (refn >= 0) {
479  const int mx = (h->mv_cache[list][scan8[0]][0] >> 2) + 16 * h->mb_x + 8;
480  const int my = (h->mv_cache[list][scan8[0]][1] >> 2) + 16 * h->mb_y;
481  uint8_t **src = h->ref_list[list][refn].f.data;
482  int off = (mx << pixel_shift) +
483  (my + (h->mb_x & 3) * 4) * h->mb_linesize +
484  (64 << pixel_shift);
485  h->vdsp.prefetch(src[0] + off, h->linesize, 4);
486  if (chroma_idc == 3 /* yuv444 */) {
487  h->vdsp.prefetch(src[1] + off, h->linesize, 4);
488  h->vdsp.prefetch(src[2] + off, h->linesize, 4);
489  } else {
490  off = ((mx >> 1) << pixel_shift) +
491  ((my >> 1) + (h->mb_x & 7)) * h->uvlinesize +
492  (64 << pixel_shift);
493  h->vdsp.prefetch(src[1] + off, src[2] - src[1], 2);
494  }
495  }
496 }
497 
499  uint8_t *src_cb, uint8_t *src_cr,
500  int linesize, int uvlinesize,
501  int xchg, int chroma444,
502  int simple, int pixel_shift)
503 {
504  int deblock_topleft;
505  int deblock_top;
506  int top_idx = 1;
507  uint8_t *top_border_m1;
508  uint8_t *top_border;
509 
510  if (!simple && FRAME_MBAFF(h)) {
511  if (h->mb_y & 1) {
512  if (!MB_MBAFF(h))
513  return;
514  } else {
515  top_idx = MB_MBAFF(h) ? 0 : 1;
516  }
517  }
518 
519  if (h->deblocking_filter == 2) {
520  deblock_topleft = h->slice_table[h->mb_xy - 1 - h->mb_stride] == h->slice_num;
521  deblock_top = h->top_type;
522  } else {
523  deblock_topleft = (h->mb_x > 0);
524  deblock_top = (h->mb_y > !!MB_FIELD(h));
525  }
526 
527  src_y -= linesize + 1 + pixel_shift;
528  src_cb -= uvlinesize + 1 + pixel_shift;
529  src_cr -= uvlinesize + 1 + pixel_shift;
530 
531  top_border_m1 = h->top_borders[top_idx][h->mb_x - 1];
532  top_border = h->top_borders[top_idx][h->mb_x];
533 
534 #define XCHG(a, b, xchg) \
535  if (pixel_shift) { \
536  if (xchg) { \
537  AV_SWAP64(b + 0, a + 0); \
538  AV_SWAP64(b + 8, a + 8); \
539  } else { \
540  AV_COPY128(b, a); \
541  } \
542  } else if (xchg) \
543  AV_SWAP64(b, a); \
544  else \
545  AV_COPY64(b, a);
546 
547  if (deblock_top) {
548  if (deblock_topleft) {
549  XCHG(top_border_m1 + (8 << pixel_shift),
550  src_y - (7 << pixel_shift), 1);
551  }
552  XCHG(top_border + (0 << pixel_shift), src_y + (1 << pixel_shift), xchg);
553  XCHG(top_border + (8 << pixel_shift), src_y + (9 << pixel_shift), 1);
554  if (h->mb_x + 1 < h->mb_width) {
555  XCHG(h->top_borders[top_idx][h->mb_x + 1],
556  src_y + (17 << pixel_shift), 1);
557  }
558  }
559  if (simple || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
560  if (chroma444) {
561  if (deblock_top) {
562  if (deblock_topleft) {
563  XCHG(top_border_m1 + (24 << pixel_shift), src_cb - (7 << pixel_shift), 1);
564  XCHG(top_border_m1 + (40 << pixel_shift), src_cr - (7 << pixel_shift), 1);
565  }
566  XCHG(top_border + (16 << pixel_shift), src_cb + (1 << pixel_shift), xchg);
567  XCHG(top_border + (24 << pixel_shift), src_cb + (9 << pixel_shift), 1);
568  XCHG(top_border + (32 << pixel_shift), src_cr + (1 << pixel_shift), xchg);
569  XCHG(top_border + (40 << pixel_shift), src_cr + (9 << pixel_shift), 1);
570  if (h->mb_x + 1 < h->mb_width) {
571  XCHG(h->top_borders[top_idx][h->mb_x + 1] + (16 << pixel_shift), src_cb + (17 << pixel_shift), 1);
572  XCHG(h->top_borders[top_idx][h->mb_x + 1] + (32 << pixel_shift), src_cr + (17 << pixel_shift), 1);
573  }
574  }
575  } else {
576  if (deblock_top) {
577  if (deblock_topleft) {
578  XCHG(top_border_m1 + (16 << pixel_shift), src_cb - (7 << pixel_shift), 1);
579  XCHG(top_border_m1 + (24 << pixel_shift), src_cr - (7 << pixel_shift), 1);
580  }
581  XCHG(top_border + (16 << pixel_shift), src_cb + 1 + pixel_shift, 1);
582  XCHG(top_border + (24 << pixel_shift), src_cr + 1 + pixel_shift, 1);
583  }
584  }
585  }
586 }
587 
588 static av_always_inline int dctcoef_get(int16_t *mb, int high_bit_depth,
589  int index)
590 {
591  if (high_bit_depth) {
592  return AV_RN32A(((int32_t *)mb) + index);
593  } else
594  return AV_RN16A(mb + index);
595 }
596 
597 static av_always_inline void dctcoef_set(int16_t *mb, int high_bit_depth,
598  int index, int value)
599 {
600  if (high_bit_depth) {
601  AV_WN32A(((int32_t *)mb) + index, value);
602  } else
603  AV_WN16A(mb + index, value);
604 }
605 
607  int mb_type, int is_h264,
608  int simple,
609  int transform_bypass,
610  int pixel_shift,
611  int *block_offset,
612  int linesize,
613  uint8_t *dest_y, int p)
614 {
615  void (*idct_add)(uint8_t *dst, int16_t *block, int stride);
616  void (*idct_dc_add)(uint8_t *dst, int16_t *block, int stride);
617  int i;
618  int qscale = p == 0 ? h->qscale : h->chroma_qp[p - 1];
619  block_offset += 16 * p;
620  if (IS_INTRA4x4(mb_type)) {
621  if (IS_8x8DCT(mb_type)) {
622  if (transform_bypass) {
623  idct_dc_add =
624  idct_add = h->h264dsp.h264_add_pixels8_clear;
625  } else {
626  idct_dc_add = h->h264dsp.h264_idct8_dc_add;
627  idct_add = h->h264dsp.h264_idct8_add;
628  }
629  for (i = 0; i < 16; i += 4) {
630  uint8_t *const ptr = dest_y + block_offset[i];
631  const int dir = h->intra4x4_pred_mode_cache[scan8[i]];
632  if (transform_bypass && h->sps.profile_idc == 244 && dir <= 1) {
633  h->hpc.pred8x8l_add[dir](ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
634  } else {
635  const int nnz = h->non_zero_count_cache[scan8[i + p * 16]];
636  h->hpc.pred8x8l[dir](ptr, (h->topleft_samples_available << i) & 0x8000,
637  (h->topright_samples_available << i) & 0x4000, linesize);
638  if (nnz) {
639  if (nnz == 1 && dctcoef_get(h->mb, pixel_shift, i * 16 + p * 256))
640  idct_dc_add(ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
641  else
642  idct_add(ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
643  }
644  }
645  }
646  } else {
647  if (transform_bypass) {
648  idct_dc_add =
649  idct_add = h->h264dsp.h264_add_pixels4_clear;
650  } else {
651  idct_dc_add = h->h264dsp.h264_idct_dc_add;
652  idct_add = h->h264dsp.h264_idct_add;
653  }
654  for (i = 0; i < 16; i++) {
655  uint8_t *const ptr = dest_y + block_offset[i];
656  const int dir = h->intra4x4_pred_mode_cache[scan8[i]];
657 
658  if (transform_bypass && h->sps.profile_idc == 244 && dir <= 1) {
659  h->hpc.pred4x4_add[dir](ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
660  } else {
661  uint8_t *topright;
662  int nnz, tr;
663  uint64_t tr_high;
664  if (dir == DIAG_DOWN_LEFT_PRED || dir == VERT_LEFT_PRED) {
665  const int topright_avail = (h->topright_samples_available << i) & 0x8000;
666  assert(h->mb_y || linesize <= block_offset[i]);
667  if (!topright_avail) {
668  if (pixel_shift) {
669  tr_high = ((uint16_t *)ptr)[3 - linesize / 2] * 0x0001000100010001ULL;
670  topright = (uint8_t *)&tr_high;
671  } else {
672  tr = ptr[3 - linesize] * 0x01010101u;
673  topright = (uint8_t *)&tr;
674  }
675  } else
676  topright = ptr + (4 << pixel_shift) - linesize;
677  } else
678  topright = NULL;
679 
680  h->hpc.pred4x4[dir](ptr, topright, linesize);
681  nnz = h->non_zero_count_cache[scan8[i + p * 16]];
682  if (nnz) {
683  if (is_h264) {
684  if (nnz == 1 && dctcoef_get(h->mb, pixel_shift, i * 16 + p * 256))
685  idct_dc_add(ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
686  else
687  idct_add(ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
688  } else if (CONFIG_SVQ3_DECODER)
689  ff_svq3_add_idct_c(ptr, h->mb + i * 16 + p * 256, linesize, qscale, 0);
690  }
691  }
692  }
693  }
694  } else {
695  h->hpc.pred16x16[h->intra16x16_pred_mode](dest_y, linesize);
696  if (is_h264) {
698  if (!transform_bypass)
699  h->h264dsp.h264_luma_dc_dequant_idct(h->mb + (p * 256 << pixel_shift),
700  h->mb_luma_dc[p],
701  h->dequant4_coeff[p][qscale][0]);
702  else {
703  static const uint8_t dc_mapping[16] = {
704  0 * 16, 1 * 16, 4 * 16, 5 * 16,
705  2 * 16, 3 * 16, 6 * 16, 7 * 16,
706  8 * 16, 9 * 16, 12 * 16, 13 * 16,
707  10 * 16, 11 * 16, 14 * 16, 15 * 16
708  };
709  for (i = 0; i < 16; i++)
710  dctcoef_set(h->mb + (p * 256 << pixel_shift),
711  pixel_shift, dc_mapping[i],
712  dctcoef_get(h->mb_luma_dc[p],
713  pixel_shift, i));
714  }
715  }
716  } else if (CONFIG_SVQ3_DECODER)
717  ff_svq3_luma_dc_dequant_idct_c(h->mb + p * 256,
718  h->mb_luma_dc[p], qscale);
719  }
720 }
721 
723  int is_h264, int simple,
724  int transform_bypass,
725  int pixel_shift,
726  int *block_offset,
727  int linesize,
728  uint8_t *dest_y, int p)
729 {
730  void (*idct_add)(uint8_t *dst, int16_t *block, int stride);
731  int i;
732  block_offset += 16 * p;
733  if (!IS_INTRA4x4(mb_type)) {
734  if (is_h264) {
735  if (IS_INTRA16x16(mb_type)) {
736  if (transform_bypass) {
737  if (h->sps.profile_idc == 244 &&
741  h->mb + (p * 256 << pixel_shift),
742  linesize);
743  } else {
744  for (i = 0; i < 16; i++)
745  if (h->non_zero_count_cache[scan8[i + p * 16]] ||
746  dctcoef_get(h->mb, pixel_shift, i * 16 + p * 256))
747  h->h264dsp.h264_add_pixels4_clear(dest_y + block_offset[i],
748  h->mb + (i * 16 + p * 256 << pixel_shift),
749  linesize);
750  }
751  } else {
752  h->h264dsp.h264_idct_add16intra(dest_y, block_offset,
753  h->mb + (p * 256 << pixel_shift),
754  linesize,
755  h->non_zero_count_cache + p * 5 * 8);
756  }
757  } else if (h->cbp & 15) {
758  if (transform_bypass) {
759  const int di = IS_8x8DCT(mb_type) ? 4 : 1;
760  idct_add = IS_8x8DCT(mb_type) ? h->h264dsp.h264_add_pixels8_clear
762  for (i = 0; i < 16; i += di)
763  if (h->non_zero_count_cache[scan8[i + p * 16]])
764  idct_add(dest_y + block_offset[i],
765  h->mb + (i * 16 + p * 256 << pixel_shift),
766  linesize);
767  } else {
768  if (IS_8x8DCT(mb_type))
769  h->h264dsp.h264_idct8_add4(dest_y, block_offset,
770  h->mb + (p * 256 << pixel_shift),
771  linesize,
772  h->non_zero_count_cache + p * 5 * 8);
773  else
774  h->h264dsp.h264_idct_add16(dest_y, block_offset,
775  h->mb + (p * 256 << pixel_shift),
776  linesize,
777  h->non_zero_count_cache + p * 5 * 8);
778  }
779  }
780  } else if (CONFIG_SVQ3_DECODER) {
781  for (i = 0; i < 16; i++)
782  if (h->non_zero_count_cache[scan8[i + p * 16]] || h->mb[i * 16 + p * 256]) {
783  // FIXME benchmark weird rule, & below
784  uint8_t *const ptr = dest_y + block_offset[i];
785  ff_svq3_add_idct_c(ptr, h->mb + i * 16 + p * 256, linesize,
786  h->qscale, IS_INTRA(mb_type) ? 1 : 0);
787  }
788  }
789  }
790 }
791 
792 #define BITS 8
793 #define SIMPLE 1
794 #include "h264_mb_template.c"
795 
796 #undef BITS
797 #define BITS 16
798 #include "h264_mb_template.c"
799 
800 #undef SIMPLE
801 #define SIMPLE 0
802 #include "h264_mb_template.c"
803 
805 {
806  const int mb_xy = h->mb_xy;
807  const int mb_type = h->cur_pic.mb_type[mb_xy];
808  int is_complex = CONFIG_SMALL || h->is_complex ||
809  IS_INTRA_PCM(mb_type) || h->qscale == 0;
810 
811  if (CHROMA444(h)) {
812  if (is_complex || h->pixel_shift)
813  hl_decode_mb_444_complex(h);
814  else
815  hl_decode_mb_444_simple_8(h);
816  } else if (is_complex) {
817  hl_decode_mb_complex(h);
818  } else if (h->pixel_shift) {
819  hl_decode_mb_simple_16(h);
820  } else
821  hl_decode_mb_simple_8(h);
822 }
#define VERT_PRED8x8
Definition: h264pred.h:70
uint8_t * edge_emu_buffer
Definition: h264.h:700
unsigned int topleft_samples_available
Definition: h264.h:361
#define IS_SUB_4X4(a)
Definition: mpegutils.h:89
void(* pred8x8l_add[2])(uint8_t *pix, int16_t *block, ptrdiff_t stride)
Definition: h264pred.h:102
static av_always_inline void xchg_mb_border(H264Context *h, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr, int linesize, int uvlinesize, int xchg, int chroma444, int simple, int pixel_shift)
Definition: h264_mb.c:498
ptrdiff_t uvlinesize
Definition: h264.h:325
#define CHROMA444(h)
Definition: h264.h:96
#define CONFIG_SVQ3_DECODER
Definition: config.h:575
int cbp
Definition: h264.h:472
void ff_h264_hl_decode_mb(H264Context *h)
Definition: h264_mb.c:804
int mb_y
Definition: h264.h:498
int flags
Definition: h264.h:335
int mb_height
Definition: h264.h:502
#define IS_SUB_8X8(a)
Definition: mpegutils.h:86
int16_t mv_cache[2][5 *8][2]
Motion vector cache.
Definition: h264.h:378
H264Context.
Definition: h264.h:303
void(* prefetch)(uint8_t *buf, ptrdiff_t stride, int h)
Prefetch memory into cache (if supported by hardware).
Definition: videodsp.h:65
void ff_thread_await_progress(ThreadFrame *f, int n, int field)
Wait for earlier decoding threads to finish reference pictures.
struct AVFrame f
Definition: h264.h:264
#define HOR_PRED8x8
Definition: h264pred.h:69
int stride
Definition: mace.c:144
int picture_structure
Definition: h264.h:419
#define AV_WN32A(p, v)
Definition: intreadwrite.h:458
int profile_idc
Definition: h264.h:158
void(* pred16x16_add[3])(uint8_t *pix, const int *block_offset, int16_t *block, ptrdiff_t stride)
Definition: h264pred.h:107
#define AV_RN32A(p)
Definition: intreadwrite.h:446
#define IS_8x8DCT(a)
Definition: h264.h:103
uint32_t(*[6] dequant4_coeff)[16]
Definition: h264.h:406
uint8_t
int use_weight
Definition: h264.h:425
float delta
int luma_weight[48][2][2]
Definition: h264.h:430
int field_picture
whether or not picture was encoded in separate fields
Definition: h264.h:293
Multithreading support functions.
int mb_xy
Definition: h264.h:505
#define LUMA_DC_BLOCK_INDEX
Definition: h264.h:864
#define IS_DIR(a, part, list)
Definition: mpegutils.h:92
void(* h264_idct_add16intra)(uint8_t *dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[15 *8])
Definition: h264dsp.h:98
quarterpel DSP functions
int mb_x
Definition: h264.h:498
void(* h264_idct_add)(uint8_t *dst, int16_t *block, int stride)
Definition: h264dsp.h:80
void(* pred4x4[9+3+3])(uint8_t *src, const uint8_t *topright, ptrdiff_t stride)
Definition: h264pred.h:93
void(* h264_idct8_dc_add)(uint8_t *dst, int16_t *block, int stride)
Definition: h264dsp.h:86
int luma_log2_weight_denom
Definition: h264.h:427
int chroma_weight[48][2][2][2]
Definition: h264.h:431
H.264 / AVC / MPEG4 part10 codec.
H264PredContext hpc
Definition: h264.h:360
int16_t mb_luma_dc[3][16 *2]
Definition: h264.h:461
void(* qpel_mc_func)(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)
Definition: qpeldsp.h:65
int use_weight_chroma
Definition: h264.h:426
static av_always_inline void hl_decode_mb_idct_luma(H264Context *h, int mb_type, int is_h264, int simple, int transform_bypass, int pixel_shift, int *block_offset, int linesize, uint8_t *dest_y, int p)
Definition: h264_mb.c:722
static av_always_inline void mc_dir_part(H264Context *h, H264Picture *pic, int n, int square, int height, int delta, int list, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int src_x_offset, int src_y_offset, qpel_mc_func *qpix_op, h264_chroma_mc_func chroma_op, int pixel_shift, int chroma_idc)
Definition: h264_mb.c:203
#define MB_FIELD(h)
Definition: h264.h:70
ThreadFrame tf
Definition: h264.h:265
static int square(int x)
Definition: roqvideoenc.c:112
#define FFMAX(a, b)
Definition: common.h:55
static void await_references(H264Context *h)
Wait until all reference frames are available for MC operations.
Definition: h264_mb.c:95
void(* h264_add_pixels8_clear)(uint8_t *dst, int16_t *block, int stride)
Definition: h264dsp.h:106
static const uint8_t scan8[16 *3+3]
Definition: h264.h:868
void(* h264_idct_add16)(uint8_t *dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[15 *8])
Definition: h264dsp.h:89
void ff_svq3_add_idct_c(uint8_t *dst, int16_t *block, int stride, int qp, int dc)
Definition: svq3.c:197
#define IS_INTRA_PCM(a)
Definition: mpegutils.h:78
#define IS_16X8(a)
Definition: mpegutils.h:83
#define IS_SUB_4X8(a)
Definition: mpegutils.h:88
ptrdiff_t linesize
Definition: h264.h:325
#define FFMIN(a, b)
Definition: common.h:57
uint16_t * slice_table
slice_table_base + 2*mb_stride + 1
Definition: h264.h:410
int reference
Definition: h264.h:296
#define FIELD_PICTURE(h)
Definition: h264.h:72
void ff_svq3_luma_dc_dequant_idct_c(int16_t *output, int16_t *input, int qp)
Definition: svq3.c:162
#define CONFIG_GRAY
Definition: config.h:341
uint32_t * mb_type
Definition: h264.h:274
void(* emulated_edge_mc)(uint8_t *buf, const uint8_t *src, ptrdiff_t buf_linesize, ptrdiff_t src_linesize, int block_w, int block_h, int src_x, int src_y, int w, int h)
Copy a rectangular area of samples to a temporary buffer and replicate the border samples...
Definition: videodsp.h:52
SPS sps
current sps
Definition: h264.h:401
int32_t
#define CONFIG_SMALL
Definition: config.h:346
void(* h264_chroma_mc_func)(uint8_t *dst, uint8_t *src, int srcStride, int h, int x, int y)
Definition: h264chroma.h:24
H264Picture ref_list[2][48]
0..15: frame refs, 16..47: mbaff field refs.
Definition: h264.h:448
int8_t intra4x4_pred_mode_cache[5 *8]
Definition: h264.h:358
uint8_t * bipred_scratchpad
Definition: h264.h:699
void(* pred4x4_add[2])(uint8_t *pix, int16_t *block, ptrdiff_t stride)
Definition: h264pred.h:100
unsigned int topright_samples_available
Definition: h264.h:363
#define AV_WN16A(p, v)
Definition: intreadwrite.h:454
int top_type
Definition: h264.h:351
#define MB_MBAFF(h)
Definition: h264.h:69
ptrdiff_t mb_uvlinesize
Definition: h264.h:399
unsigned int list_count
Definition: h264.h:446
#define IS_INTRA16x16(a)
Definition: mpegutils.h:72
if(ac->has_optimized_func)
void(* h264_idct8_add)(uint8_t *dst, int16_t *block, int stride)
Definition: h264dsp.h:82
static av_always_inline void dctcoef_set(int16_t *mb, int high_bit_depth, int index, int value)
Definition: h264_mb.c:597
AVBufferRef * progress
Definition: thread.h:40
int chroma_log2_weight_denom
Definition: h264.h:428
VideoDSPContext vdsp
Definition: h264.h:306
NULL
Definition: eval.c:55
int mb_stride
Definition: h264.h:503
#define IS_SUB_8X4(a)
Definition: mpegutils.h:87
Libavcodec external API header.
int implicit_weight[48][48][2]
Definition: h264.h:432
static void(WINAPI *cond_broadcast)(pthread_cond_t *cond)
uint8_t * data
The data buffer.
Definition: buffer.h:89
int16_t mb[16 *48 *2]
as a dct coeffecient is int32_t in high depth, we need to reserve twice the space.
Definition: h264.h:460
static av_always_inline int dctcoef_get(int16_t *mb, int high_bit_depth, int index)
Definition: h264_mb.c:588
void(* pred16x16[4+3+2])(uint8_t *src, ptrdiff_t stride)
Definition: h264pred.h:98
void(* h264_idct8_add4)(uint8_t *dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[15 *8])
Definition: h264dsp.h:92
#define IS_16X16(a)
Definition: mpegutils.h:82
int index
Definition: gxfenc.c:72
#define IS_8X16(a)
Definition: mpegutils.h:84
static av_always_inline void hl_decode_mb_predict_luma(H264Context *h, int mb_type, int is_h264, int simple, int transform_bypass, int pixel_shift, int *block_offset, int linesize, uint8_t *dest_y, int p)
Definition: h264_mb.c:606
int pixel_shift
0 for 8-bit H264, 1 for high-bit-depth H264
Definition: h264.h:318
void(* h264_luma_dc_dequant_idct)(int16_t *output, int16_t *input, int qmul)
Definition: h264dsp.h:101
static av_always_inline void prefetch_motion(H264Context *h, int list, int pixel_shift, int chroma_idc)
Definition: h264_mb.c:472
void(* h264_add_pixels4_clear)(uint8_t *dst, int16_t *block, int stride)
Definition: h264dsp.h:107
static void get_lowest_part_y(H264Context *h, int refs[2][48], int n, int height, int y_offset, int list0, int list1, int *nrefs)
Definition: h264_mb.c:52
static av_always_inline void mc_part_std(H264Context *h, int n, int square, int height, int delta, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int x_offset, int y_offset, qpel_mc_func *qpix_put, h264_chroma_mc_func chroma_put, qpel_mc_func *qpix_avg, h264_chroma_mc_func chroma_avg, int list0, int list1, int pixel_shift, int chroma_idc)
Definition: h264_mb.c:318
int block_offset[2 *(16 *3)]
block_offset[ 0..23] for frame macroblocks block_offset[24..47] for field macroblocks ...
Definition: h264.h:392
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:141
int height
Definition: gxfenc.c:72
int is_complex
Definition: h264.h:507
int qscale
Definition: h264.h:328
common internal and external API header
#define CODEC_FLAG_GRAY
Only decode/encode grayscale.
Definition: avcodec.h:637
ptrdiff_t mb_linesize
may be equal to s->linesize or s->linesize * 2, for mbaff
Definition: h264.h:398
int chroma_qp[2]
Definition: h264.h:319
static av_always_inline void mc_part_weighted(H264Context *h, int n, int square, int height, int delta, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int x_offset, int y_offset, qpel_mc_func *qpix_put, h264_chroma_mc_func chroma_put, h264_weight_func luma_weight_op, h264_weight_func chroma_weight_op, h264_biweight_func luma_weight_avg, h264_biweight_func chroma_weight_avg, int list0, int list1, int pixel_shift, int chroma_idc)
Definition: h264_mb.c:365
uint16_t sub_mb_type[4]
Definition: h264.h:422
void(* h264_weight_func)(uint8_t *block, int stride, int height, int log2_denom, int weight, int offset)
Definition: h264dsp.h:32
int intra16x16_pred_mode
Definition: h264.h:343
#define IS_INTRA(x, y)
#define IS_INTRA4x4(a)
Definition: mpegutils.h:71
#define IS_8X8(a)
Definition: mpegutils.h:85
#define FRAME_MBAFF(h)
Definition: h264.h:71
uint8_t non_zero_count_cache[15 *8]
non zero coeff count cache.
Definition: h264.h:371
uint8_t(*[2] top_borders)[(16 *3)*2]
Definition: h264.h:365
H264Picture cur_pic
Definition: h264.h:316
int mb_width
Definition: h264.h:502
#define AV_RN16A(p)
Definition: intreadwrite.h:442
H264DSPContext h264dsp
Definition: h264.h:307
void(* h264_idct_dc_add)(uint8_t *dst, int16_t *block, int stride)
Definition: h264dsp.h:84
#define XCHG(a, b, xchg)
#define av_always_inline
Definition: attributes.h:40
static int get_lowest_part_list_y(H264Context *h, H264Picture *pic, int n, int height, int y_offset, int list)
Definition: h264_mb.c:39
int deblocking_filter
disable_deblocking_filter_idc with 1 <-> 0
Definition: h264.h:510
void(* h264_biweight_func)(uint8_t *dst, uint8_t *src, int stride, int height, int log2_denom, int weightd, int weights, int offset)
Definition: h264dsp.h:34
int slice_num
Definition: h264.h:409
void(* pred8x8l[9+3])(uint8_t *src, int topleft, int topright, ptrdiff_t stride)
Definition: h264pred.h:95
int8_t ref_cache[2][5 *8]
Definition: h264.h:379
static int16_t block[64]
Definition: dct-test.c:88