26 # define FUNC(n) AV_JOIN(n ## _simple_, BITS)
27 # define PIXEL_SHIFT (BITS >> 4)
29 # define FUNC(n) n ## _complex
30 # define PIXEL_SHIFT h->pixel_shift
44 const int mb_x = s->
mb_x;
45 const int mb_y = s->
mb_y;
46 const int mb_xy = h->mb_xy;
48 uint8_t *dest_y, *dest_cb, *dest_cr;
49 int linesize, uvlinesize ;
52 const int transform_bypass = !
SIMPLE && (s->
qscale == 0 && h->sps.transform_bypass);
66 h->list_counts[
mb_xy] = h->list_count;
69 linesize = h->mb_linesize = s->
linesize * 2;
70 uvlinesize = h->mb_uvlinesize = s->
uvlinesize * 2;
71 block_offset = &h->block_offset[48];
79 for (list = 0; list < h->list_count; list++) {
83 int8_t *ref = &h->ref_cache[list][
scan8[0]];
86 for (i = 0; i < 16; i += 4) {
87 int ref = h->ref_cache[list][
scan8[i]];
90 8, (16 + ref) ^ (s->
mb_y & 1), 1);
96 linesize = h->mb_linesize = s->
linesize;
102 const int bit_depth = h->sps.bit_depth_luma;
109 for (i = 0; i < 16; i++) {
110 uint16_t *tmp_y = (uint16_t *)(dest_y + i * linesize);
111 for (j = 0; j < 16; j++)
112 tmp_y[j] =
get_bits(&gb, bit_depth);
115 if (!h->sps.chroma_format_idc) {
116 for (i = 0; i < block_h; i++) {
117 uint16_t *tmp_cb = (uint16_t *)(dest_cb + i * uvlinesize);
118 uint16_t *tmp_cr = (uint16_t *)(dest_cr + i * uvlinesize);
119 for (j = 0; j < 8; j++) {
120 tmp_cb[j] = tmp_cr[j] = 1 << (bit_depth - 1);
124 for (i = 0; i < block_h; i++) {
125 uint16_t *tmp_cb = (uint16_t *)(dest_cb + i * uvlinesize);
126 for (j = 0; j < 8; j++)
127 tmp_cb[j] =
get_bits(&gb, bit_depth);
129 for (i = 0; i < block_h; i++) {
130 uint16_t *tmp_cr = (uint16_t *)(dest_cr + i * uvlinesize);
131 for (j = 0; j < 8; j++)
132 tmp_cr[j] =
get_bits(&gb, bit_depth);
137 for (i = 0; i < 16; i++)
138 memcpy(dest_y + i * linesize, (
uint8_t *)h->mb + i * 16, 16);
140 if (!h->sps.chroma_format_idc) {
141 for (i = 0; i < 8; i++) {
142 memset(dest_cb + i*uvlinesize, 1 << (bit_depth - 1), 8);
143 memset(dest_cr + i*uvlinesize, 1 << (bit_depth - 1), 8);
148 for (i = 0; i < block_h; i++) {
149 memcpy(dest_cb + i * uvlinesize, src_cb + i * 8, 8);
150 memcpy(dest_cr + i * uvlinesize, src_cr + i * 8, 8);
157 if (h->deblocking_filter)
162 h->hpc.pred8x8[h->chroma_pred_mode](dest_cb, uvlinesize);
163 h->hpc.pred8x8[h->chroma_pred_mode](dest_cr, uvlinesize);
168 block_offset, linesize, dest_y, 0);
170 if (h->deblocking_filter)
173 }
else if (is_h264) {
175 FUNC(hl_motion_422)(h, dest_y, dest_cb, dest_cr,
178 h->h264dsp.weight_h264_pixels_tab,
179 h->h264dsp.biweight_h264_pixels_tab);
181 FUNC(hl_motion_420)(h, dest_y, dest_cb, dest_cr,
184 h->h264dsp.weight_h264_pixels_tab,
185 h->h264dsp.biweight_h264_pixels_tab);
194 uint8_t *dest[2] = { dest_cb, dest_cr };
195 if (transform_bypass) {
196 if (
IS_INTRA(mb_type) && h->sps.profile_idc == 244 &&
199 h->hpc.pred8x8_add[h->chroma_pred_mode](dest[0],
203 h->hpc.pred8x8_add[h->chroma_pred_mode](dest[1],
209 for (j = 1; j < 3; j++) {
210 for (i = j * 16; i < j * 16 + 4; i++)
211 if (h->non_zero_count_cache[
scan8[i]] ||
213 idct_add(dest[j - 1] + block_offset[i],
217 for (i = j * 16 + 4; i < j * 16 + 8; i++)
218 if (h->non_zero_count_cache[
scan8[i + 4]] ||
220 idct_add(dest[j - 1] + block_offset[i + 4],
230 qp[0] = h->chroma_qp[0] + 3;
231 qp[1] = h->chroma_qp[1] + 3;
233 qp[0] = h->chroma_qp[0];
234 qp[1] = h->chroma_qp[1];
237 h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + (16 * 16 * 1 <<
PIXEL_SHIFT),
238 h->dequant4_coeff[
IS_INTRA(mb_type) ? 1 : 4][qp[0]][0]);
240 h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + (16 * 16 * 2 <<
PIXEL_SHIFT),
241 h->dequant4_coeff[
IS_INTRA(mb_type) ? 2 : 5][qp[1]][0]);
242 h->h264dsp.h264_idct_add8(dest, block_offset,
244 h->non_zero_count_cache);
245 }
else if (CONFIG_SVQ3_DECODER) {
246 h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + 16 * 16 * 1,
247 h->dequant4_coeff[
IS_INTRA(mb_type) ? 1 : 4][h->chroma_qp[0]][0]);
248 h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + 16 * 16 * 2,
249 h->dequant4_coeff[
IS_INTRA(mb_type) ? 2 : 5][h->chroma_qp[1]][0]);
250 for (j = 1; j < 3; j++) {
251 for (i = j * 16; i < j * 16 + 4; i++)
252 if (h->non_zero_count_cache[
scan8[i]] || h->mb[i * 16]) {
253 uint8_t *
const ptr = dest[j - 1] + block_offset[i];
269 #if !SIMPLE || BITS == 8
278 const int mb_x = s->
mb_x;
279 const int mb_y = s->
mb_y;
280 const int mb_xy = h->mb_xy;
286 const int transform_bypass = !
SIMPLE && (s->
qscale == 0 && h->sps.transform_bypass);
289 for (p = 0; p < plane_count; p++) {
296 h->list_counts[
mb_xy] = h->list_count;
299 linesize = h->mb_linesize = h->mb_uvlinesize = s->
linesize * 2;
300 block_offset = &h->block_offset[48];
302 for (p = 0; p < 3; p++)
306 for (list = 0; list < h->list_count; list++) {
310 int8_t *ref = &h->ref_cache[list][
scan8[0]];
313 for (i = 0; i < 16; i += 4) {
314 int ref = h->ref_cache[list][
scan8[i]];
317 8, (16 + ref) ^ (s->
mb_y & 1), 1);
323 linesize = h->mb_linesize = h->mb_uvlinesize = s->
linesize;
328 const int bit_depth = h->sps.bit_depth_luma;
332 for (p = 0; p < plane_count; p++)
333 for (i = 0; i < 16; i++) {
334 uint16_t *tmp = (uint16_t *)(dest[p] + i * linesize);
335 for (j = 0; j < 16; j++)
339 for (p = 0; p < plane_count; p++)
340 for (i = 0; i < 16; i++)
341 memcpy(dest[p] + i * linesize,
342 (
uint8_t *)h->mb + p * 256 + i * 16, 16);
346 if (h->deblocking_filter)
350 for (p = 0; p < plane_count; p++)
353 block_offset, linesize, dest[p], p);
355 if (h->deblocking_filter)
359 FUNC(hl_motion_444)(h, dest[0], dest[1], dest[2],
362 h->h264dsp.weight_h264_pixels_tab,
363 h->h264dsp.biweight_h264_pixels_tab);
366 for (p = 0; p < plane_count; p++)