| Line | Branch | Exec | Source |
|---|---|---|---|
| 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 FFmpeg. | ||
| 6 | * | ||
| 7 | * FFmpeg 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 | * FFmpeg 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 FFmpeg; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 20 | */ | ||
| 21 | |||
| 22 | #undef FUNC | ||
| 23 | #undef PIXEL_SHIFT | ||
| 24 | |||
| 25 | #if SIMPLE | ||
| 26 | # define FUNC(n) AV_JOIN(n ## _simple_, BITS) | ||
| 27 | # define PIXEL_SHIFT (BITS >> 4) | ||
| 28 | #else | ||
| 29 | # define FUNC(n) n ## _complex | ||
| 30 | # define PIXEL_SHIFT h->pixel_shift | ||
| 31 | #endif | ||
| 32 | |||
| 33 | #undef CHROMA_IDC | ||
| 34 | #define CHROMA_IDC 1 | ||
| 35 | #include "h264_mc_template.c" | ||
| 36 | |||
| 37 | #undef CHROMA_IDC | ||
| 38 | #define CHROMA_IDC 2 | ||
| 39 | #include "h264_mc_template.c" | ||
| 40 | |||
| 41 | 30321316 | static av_noinline void FUNC(hl_decode_mb)(const H264Context *h, H264SliceContext *sl) | |
| 42 | { | ||
| 43 | 30321316 | const int mb_x = sl->mb_x; | |
| 44 | 30321316 | const int mb_y = sl->mb_y; | |
| 45 | 30321316 | const int mb_xy = sl->mb_xy; | |
| 46 | 30321316 | const int mb_type = h->cur_pic.mb_type[mb_xy]; | |
| 47 | uint8_t *dest_y, *dest_cb, *dest_cr; | ||
| 48 | int linesize, uvlinesize /*dct_offset*/; | ||
| 49 | int i, j; | ||
| 50 | 30321316 | const int *block_offset = &h->block_offset[0]; | |
| 51 |
4/4✓ Branch 0 taken 24584 times.
✓ Branch 1 taken 7047682 times.
✓ Branch 2 taken 20400 times.
✓ Branch 3 taken 4184 times.
|
30321316 | const int transform_bypass = !SIMPLE && (sl->qscale == 0 && h->ps.sps->transform_bypass); |
| 52 | void (*idct_add)(uint8_t *dst, int16_t *block, int stride); | ||
| 53 | 30321316 | const int block_h = 16 >> h->chroma_y_shift; | |
| 54 | 30321316 | const int chroma422 = CHROMA422(h); | |
| 55 | |||
| 56 | 30321316 | dest_y = h->cur_pic.f->data[0] + ((mb_x << PIXEL_SHIFT) + mb_y * sl->linesize) * 16; | |
| 57 | 30321316 | dest_cb = h->cur_pic.f->data[1] + (mb_x << PIXEL_SHIFT) * 8 + mb_y * sl->uvlinesize * block_h; | |
| 58 | 30321316 | dest_cr = h->cur_pic.f->data[2] + (mb_x << PIXEL_SHIFT) * 8 + mb_y * sl->uvlinesize * block_h; | |
| 59 | |||
| 60 | 30321316 | h->vdsp.prefetch(dest_y + (sl->mb_x & 3) * 4 * sl->linesize + (64 << PIXEL_SHIFT), sl->linesize, 4); | |
| 61 | 30321316 | h->vdsp.prefetch(dest_cb + (sl->mb_x & 7) * sl->uvlinesize + (64 << PIXEL_SHIFT), dest_cr - dest_cb, 2); | |
| 62 | |||
| 63 | 30321316 | h->list_counts[mb_xy] = sl->list_count; | |
| 64 | |||
| 65 |
2/2✓ Branch 0 taken 5369955 times.
✓ Branch 1 taken 1702311 times.
|
14144532 | if (!SIMPLE && MB_FIELD(sl)) { |
| 66 | 10739910 | linesize = sl->mb_linesize = sl->linesize * 2; | |
| 67 | 10739910 | uvlinesize = sl->mb_uvlinesize = sl->uvlinesize * 2; | |
| 68 | 10739910 | block_offset = &h->block_offset[48]; | |
| 69 |
2/2✓ Branch 0 taken 2680796 times.
✓ Branch 1 taken 2689159 times.
|
10739910 | if (mb_y & 1) { // FIXME move out of this function? |
| 70 | 5361592 | dest_y -= sl->linesize * 15; | |
| 71 | 5361592 | dest_cb -= sl->uvlinesize * (block_h - 1); | |
| 72 | 5361592 | dest_cr -= sl->uvlinesize * (block_h - 1); | |
| 73 | } | ||
| 74 |
2/2✓ Branch 0 taken 660568 times.
✓ Branch 1 taken 4709387 times.
|
10739910 | if (FRAME_MBAFF(h)) { |
| 75 | int list; | ||
| 76 |
2/2✓ Branch 0 taken 800470 times.
✓ Branch 1 taken 660568 times.
|
2922076 | for (list = 0; list < sl->list_count; list++) { |
| 77 |
2/2✓ Branch 0 taken 200960 times.
✓ Branch 1 taken 599510 times.
|
1600940 | if (!USES_LIST(mb_type, list)) |
| 78 | 401920 | continue; | |
| 79 |
2/2✓ Branch 0 taken 297379 times.
✓ Branch 1 taken 302131 times.
|
1199020 | if (IS_16X16(mb_type)) { |
| 80 | 594758 | int8_t *ref = &sl->ref_cache[list][scan8[0]]; | |
| 81 | 594758 | fill_rectangle(ref, 4, 4, 8, (16 + *ref) ^ (sl->mb_y & 1), 1); | |
| 82 | } else { | ||
| 83 |
2/2✓ Branch 0 taken 1208524 times.
✓ Branch 1 taken 302131 times.
|
3021310 | for (i = 0; i < 16; i += 4) { |
| 84 | 2417048 | int ref = sl->ref_cache[list][scan8[i]]; | |
| 85 |
2/2✓ Branch 0 taken 1060249 times.
✓ Branch 1 taken 148275 times.
|
2417048 | if (ref >= 0) |
| 86 | 2120498 | fill_rectangle(&sl->ref_cache[list][scan8[i]], 2, 2, | |
| 87 | 2120498 | 8, (16 + ref) ^ (sl->mb_y & 1), 1); | |
| 88 | } | ||
| 89 | } | ||
| 90 | } | ||
| 91 | } | ||
| 92 | } else { | ||
| 93 | 19581406 | linesize = sl->mb_linesize = sl->linesize; | |
| 94 | 19581406 | uvlinesize = sl->mb_uvlinesize = sl->uvlinesize; | |
| 95 | // dct_offset = s->linesize * 16; | ||
| 96 | } | ||
| 97 | |||
| 98 |
2/2✓ Branch 0 taken 23105 times.
✓ Branch 1 taken 7049161 times.
|
14144532 | if (!SIMPLE && IS_INTRA_PCM(mb_type)) { |
| 99 | 46210 | const int bit_depth = h->ps.sps->bit_depth_luma; | |
| 100 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 23105 times.
|
46210 | if (PIXEL_SHIFT) { |
| 101 | int j; | ||
| 102 | GetBitContext gb; | ||
| 103 | ✗ | init_get_bits(&gb, sl->intra_pcm_ptr, | |
| 104 | ✗ | ff_h264_mb_sizes[h->ps.sps->chroma_format_idc] * bit_depth); | |
| 105 | |||
| 106 | ✗ | for (i = 0; i < 16; i++) { | |
| 107 | ✗ | uint16_t *tmp_y = (uint16_t *)(dest_y + i * linesize); | |
| 108 | ✗ | for (j = 0; j < 16; j++) | |
| 109 | ✗ | tmp_y[j] = get_bits(&gb, bit_depth); | |
| 110 | } | ||
| 111 | if (SIMPLE || !CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) { | ||
| 112 | ✗ | if (!h->ps.sps->chroma_format_idc) { | |
| 113 | ✗ | for (i = 0; i < block_h; i++) { | |
| 114 | ✗ | uint16_t *tmp_cb = (uint16_t *)(dest_cb + i * uvlinesize); | |
| 115 | ✗ | uint16_t *tmp_cr = (uint16_t *)(dest_cr + i * uvlinesize); | |
| 116 | ✗ | for (j = 0; j < 8; j++) { | |
| 117 | ✗ | tmp_cb[j] = tmp_cr[j] = 1 << (bit_depth - 1); | |
| 118 | } | ||
| 119 | } | ||
| 120 | } else { | ||
| 121 | ✗ | for (i = 0; i < block_h; i++) { | |
| 122 | ✗ | uint16_t *tmp_cb = (uint16_t *)(dest_cb + i * uvlinesize); | |
| 123 | ✗ | for (j = 0; j < 8; j++) | |
| 124 | ✗ | tmp_cb[j] = get_bits(&gb, bit_depth); | |
| 125 | } | ||
| 126 | ✗ | for (i = 0; i < block_h; i++) { | |
| 127 | ✗ | uint16_t *tmp_cr = (uint16_t *)(dest_cr + i * uvlinesize); | |
| 128 | ✗ | for (j = 0; j < 8; j++) | |
| 129 | ✗ | tmp_cr[j] = get_bits(&gb, bit_depth); | |
| 130 | } | ||
| 131 | } | ||
| 132 | } | ||
| 133 | } else { | ||
| 134 |
2/2✓ Branch 0 taken 369680 times.
✓ Branch 1 taken 23105 times.
|
785570 | for (i = 0; i < 16; i++) |
| 135 | 739360 | memcpy(dest_y + i * linesize, sl->intra_pcm_ptr + i * 16, 16); | |
| 136 | if (SIMPLE || !CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) { | ||
| 137 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 23105 times.
|
46210 | if (!h->ps.sps->chroma_format_idc) { |
| 138 | ✗ | for (i = 0; i < 8; i++) { | |
| 139 | ✗ | memset(dest_cb + i * uvlinesize, 1 << (bit_depth - 1), 8); | |
| 140 | ✗ | memset(dest_cr + i * uvlinesize, 1 << (bit_depth - 1), 8); | |
| 141 | } | ||
| 142 | } else { | ||
| 143 | 46210 | const uint8_t *src_cb = sl->intra_pcm_ptr + 256; | |
| 144 | 46210 | const uint8_t *src_cr = sl->intra_pcm_ptr + 256 + block_h * 8; | |
| 145 |
2/2✓ Branch 0 taken 184840 times.
✓ Branch 1 taken 23105 times.
|
415890 | for (i = 0; i < block_h; i++) { |
| 146 | 369680 | memcpy(dest_cb + i * uvlinesize, src_cb + i * 8, 8); | |
| 147 | 369680 | memcpy(dest_cr + i * uvlinesize, src_cr + i * 8, 8); | |
| 148 | } | ||
| 149 | } | ||
| 150 | } | ||
| 151 | } | ||
| 152 | } else { | ||
| 153 |
2/2✓ Branch 0 taken 4057618 times.
✓ Branch 1 taken 11079935 times.
|
30275106 | if (IS_INTRA(mb_type)) { |
| 154 |
2/2✓ Branch 0 taken 3337290 times.
✓ Branch 1 taken 720328 times.
|
8115236 | if (sl->deblocking_filter) |
| 155 | 6674580 | xchg_mb_border(h, sl, dest_y, dest_cb, dest_cr, linesize, | |
| 156 | 3064054 | uvlinesize, 1, 0, SIMPLE, PIXEL_SHIFT); | |
| 157 | |||
| 158 | if (SIMPLE || !CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) { | ||
| 159 | 8115236 | h->hpc.pred8x8[sl->chroma_pred_mode](dest_cb, uvlinesize); | |
| 160 | 8115236 | h->hpc.pred8x8[sl->chroma_pred_mode](dest_cr, uvlinesize); | |
| 161 | } | ||
| 162 | |||
| 163 | 8115236 | hl_decode_mb_predict_luma(h, sl, mb_type, SIMPLE, | |
| 164 | 3475434 | transform_bypass, PIXEL_SHIFT, | |
| 165 | block_offset, linesize, dest_y, 0); | ||
| 166 | |||
| 167 |
2/2✓ Branch 0 taken 3337290 times.
✓ Branch 1 taken 720328 times.
|
8115236 | if (sl->deblocking_filter) |
| 168 | 6674580 | xchg_mb_border(h, sl, dest_y, dest_cb, dest_cr, linesize, | |
| 169 | 3064054 | uvlinesize, 0, 0, SIMPLE, PIXEL_SHIFT); | |
| 170 | } else { | ||
| 171 |
2/2✓ Branch 0 taken 57285 times.
✓ Branch 1 taken 11022650 times.
|
22159870 | if (chroma422) { |
| 172 | 114570 | FUNC(hl_motion_422)(h, sl, dest_y, dest_cb, dest_cr, | |
| 173 | 114570 | h->h264qpel.put_h264_qpel_pixels_tab, | |
| 174 | 114570 | h->h264chroma.put_h264_chroma_pixels_tab, | |
| 175 | 114570 | h->h264qpel.avg_h264_qpel_pixels_tab, | |
| 176 | 114570 | h->h264chroma.avg_h264_chroma_pixels_tab, | |
| 177 | 114570 | h->h264dsp.weight_h264_pixels_tab, | |
| 178 | 114570 | h->h264dsp.biweight_h264_pixels_tab); | |
| 179 | } else { | ||
| 180 | 22045300 | FUNC(hl_motion_420)(h, sl, dest_y, dest_cb, dest_cr, | |
| 181 | 22045300 | h->h264qpel.put_h264_qpel_pixels_tab, | |
| 182 | 22045300 | h->h264chroma.put_h264_chroma_pixels_tab, | |
| 183 | 22045300 | h->h264qpel.avg_h264_qpel_pixels_tab, | |
| 184 | 22045300 | h->h264chroma.avg_h264_chroma_pixels_tab, | |
| 185 | 22045300 | h->h264dsp.weight_h264_pixels_tab, | |
| 186 | 22045300 | h->h264dsp.biweight_h264_pixels_tab); | |
| 187 | } | ||
| 188 | } | ||
| 189 | |||
| 190 | 30275106 | hl_decode_mb_idct_luma(h, sl, mb_type, SIMPLE, transform_bypass, | |
| 191 | 14098322 | PIXEL_SHIFT, block_offset, linesize, dest_y, 0); | |
| 192 | |||
| 193 | 30275106 | if ((SIMPLE || !CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) && | |
| 194 |
2/2✓ Branch 0 taken 5491535 times.
✓ Branch 1 taken 9646018 times.
|
30275106 | (sl->cbp & 0x30)) { |
| 195 | 10983070 | uint8_t *dest[2] = { dest_cb, dest_cr }; | |
| 196 |
2/2✓ Branch 0 taken 19181 times.
✓ Branch 1 taken 5472354 times.
|
10983070 | if (transform_bypass) { |
| 197 |
3/4✓ Branch 0 taken 2812 times.
✓ Branch 1 taken 16369 times.
✓ Branch 2 taken 2812 times.
✗ Branch 3 not taken.
|
38362 | if (IS_INTRA(mb_type) && h->ps.sps->profile_idc == 244 && |
| 198 |
2/2✓ Branch 0 taken 1683 times.
✓ Branch 1 taken 1129 times.
|
5624 | (sl->chroma_pred_mode == VERT_PRED8x8 || |
| 199 |
2/2✓ Branch 0 taken 1444 times.
✓ Branch 1 taken 239 times.
|
3366 | sl->chroma_pred_mode == HOR_PRED8x8)) { |
| 200 | 5146 | h->hpc.pred8x8_add[sl->chroma_pred_mode](dest[0], | |
| 201 | block_offset + 16, | ||
| 202 | 5146 | sl->mb + (16 * 16 * 1 << PIXEL_SHIFT), | |
| 203 | uvlinesize); | ||
| 204 | 5146 | h->hpc.pred8x8_add[sl->chroma_pred_mode](dest[1], | |
| 205 | block_offset + 32, | ||
| 206 | 5146 | sl->mb + (16 * 16 * 2 << PIXEL_SHIFT), | |
| 207 | uvlinesize); | ||
| 208 | } else { | ||
| 209 | 33216 | idct_add = h->h264dsp.h264_add_pixels4_clear; | |
| 210 |
2/2✓ Branch 0 taken 33216 times.
✓ Branch 1 taken 16608 times.
|
99648 | for (j = 1; j < 3; j++) { |
| 211 |
2/2✓ Branch 0 taken 132864 times.
✓ Branch 1 taken 33216 times.
|
332160 | for (i = j * 16; i < j * 16 + 4; i++) |
| 212 |
4/4✓ Branch 0 taken 33405 times.
✓ Branch 1 taken 99459 times.
✓ Branch 2 taken 715 times.
✓ Branch 3 taken 32690 times.
|
332538 | if (sl->non_zero_count_cache[scan8[i]] || |
| 213 | 66810 | dctcoef_get(sl->mb, PIXEL_SHIFT, i * 16)) | |
| 214 | 200348 | idct_add(dest[j - 1] + block_offset[i], | |
| 215 | 200348 | sl->mb + (i * 16 << PIXEL_SHIFT), | |
| 216 | uvlinesize); | ||
| 217 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 33216 times.
|
66432 | if (chroma422) { |
| 218 | ✗ | for (i = j * 16 + 4; i < j * 16 + 8; i++) | |
| 219 | ✗ | if (sl->non_zero_count_cache[scan8[i + 4]] || | |
| 220 | ✗ | dctcoef_get(sl->mb, PIXEL_SHIFT, i * 16)) | |
| 221 | ✗ | idct_add(dest[j - 1] + block_offset[i + 4], | |
| 222 | ✗ | sl->mb + (i * 16 << PIXEL_SHIFT), | |
| 223 | uvlinesize); | ||
| 224 | } | ||
| 225 | } | ||
| 226 | } | ||
| 227 | } else { | ||
| 228 | int qp[2]; | ||
| 229 |
2/2✓ Branch 0 taken 675318 times.
✓ Branch 1 taken 4797036 times.
|
10944708 | if (chroma422) { |
| 230 | 1350636 | qp[0] = sl->chroma_qp[0] + 3; | |
| 231 | 1350636 | qp[1] = sl->chroma_qp[1] + 3; | |
| 232 | } else { | ||
| 233 | 9594072 | qp[0] = sl->chroma_qp[0]; | |
| 234 | 9594072 | qp[1] = sl->chroma_qp[1]; | |
| 235 | } | ||
| 236 |
2/2✓ Branch 0 taken 3946711 times.
✓ Branch 1 taken 1525643 times.
|
10944708 | if (sl->non_zero_count_cache[scan8[CHROMA_DC_BLOCK_INDEX + 0]]) |
| 237 | 15786844 | h->h264dsp.h264_chroma_dc_dequant_idct(sl->mb + (16 * 16 * 1 << PIXEL_SHIFT), | |
| 238 |
2/2✓ Branch 0 taken 2213954 times.
✓ Branch 1 taken 1732757 times.
|
7893422 | h->ps.pps->dequant4_coeff[IS_INTRA(mb_type) ? 1 : 4][qp[0]][0]); |
| 239 |
2/2✓ Branch 0 taken 3440652 times.
✓ Branch 1 taken 2031702 times.
|
10944708 | if (sl->non_zero_count_cache[scan8[CHROMA_DC_BLOCK_INDEX + 1]]) |
| 240 | 13762608 | h->h264dsp.h264_chroma_dc_dequant_idct(sl->mb + (16 * 16 * 2 << PIXEL_SHIFT), | |
| 241 |
2/2✓ Branch 0 taken 1946920 times.
✓ Branch 1 taken 1493732 times.
|
6881304 | h->ps.pps->dequant4_coeff[IS_INTRA(mb_type) ? 2 : 5][qp[1]][0]); |
| 242 | 10944708 | h->h264dsp.h264_idct_add8(dest, block_offset, | |
| 243 | 10944708 | sl->mb, uvlinesize, | |
| 244 | 10944708 | sl->non_zero_count_cache); | |
| 245 | } | ||
| 246 | } | ||
| 247 | } | ||
| 248 | 30321316 | } | |
| 249 | |||
| 250 | #if !SIMPLE || BITS == 8 | ||
| 251 | |||
| 252 | #undef CHROMA_IDC | ||
| 253 | #define CHROMA_IDC 3 | ||
| 254 | #include "h264_mc_template.c" | ||
| 255 | |||
| 256 | 385316 | static av_noinline void FUNC(hl_decode_mb_444)(const H264Context *h, H264SliceContext *sl) | |
| 257 | { | ||
| 258 | 385316 | const int mb_x = sl->mb_x; | |
| 259 | 385316 | const int mb_y = sl->mb_y; | |
| 260 | 385316 | const int mb_xy = sl->mb_xy; | |
| 261 | 385316 | const int mb_type = h->cur_pic.mb_type[mb_xy]; | |
| 262 | uint8_t *dest[3]; | ||
| 263 | int linesize; | ||
| 264 | int i, j, p; | ||
| 265 | 385316 | const int *block_offset = &h->block_offset[0]; | |
| 266 |
4/4✓ Branch 0 taken 112792 times.
✓ Branch 1 taken 19800 times.
✓ Branch 2 taken 112320 times.
✓ Branch 3 taken 472 times.
|
385316 | const int transform_bypass = !SIMPLE && (sl->qscale == 0 && h->ps.sps->transform_bypass); |
| 267 | 385316 | const int plane_count = (SIMPLE || !CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) ? 3 : 1; | |
| 268 | |||
| 269 |
2/2✓ Branch 0 taken 577974 times.
✓ Branch 1 taken 192658 times.
|
1541264 | for (p = 0; p < plane_count; p++) { |
| 270 | 1155948 | dest[p] = h->cur_pic.f->data[p] + | |
| 271 | 1155948 | ((mb_x << PIXEL_SHIFT) + mb_y * sl->linesize) * 16; | |
| 272 | 1155948 | h->vdsp.prefetch(dest[p] + (sl->mb_x & 3) * 4 * sl->linesize + (64 << PIXEL_SHIFT), | |
| 273 | sl->linesize, 4); | ||
| 274 | } | ||
| 275 | |||
| 276 | 385316 | h->list_counts[mb_xy] = sl->list_count; | |
| 277 | |||
| 278 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 132592 times.
|
265184 | if (!SIMPLE && MB_FIELD(sl)) { |
| 279 | ✗ | linesize = sl->mb_linesize = sl->mb_uvlinesize = sl->linesize * 2; | |
| 280 | ✗ | block_offset = &h->block_offset[48]; | |
| 281 | ✗ | if (mb_y & 1) // FIXME move out of this function? | |
| 282 | ✗ | for (p = 0; p < 3; p++) | |
| 283 | ✗ | dest[p] -= sl->linesize * 15; | |
| 284 | ✗ | if (FRAME_MBAFF(h)) { | |
| 285 | int list; | ||
| 286 | ✗ | for (list = 0; list < sl->list_count; list++) { | |
| 287 | ✗ | if (!USES_LIST(mb_type, list)) | |
| 288 | ✗ | continue; | |
| 289 | ✗ | if (IS_16X16(mb_type)) { | |
| 290 | ✗ | int8_t *ref = &sl->ref_cache[list][scan8[0]]; | |
| 291 | ✗ | fill_rectangle(ref, 4, 4, 8, (16 + *ref) ^ (sl->mb_y & 1), 1); | |
| 292 | } else { | ||
| 293 | ✗ | for (i = 0; i < 16; i += 4) { | |
| 294 | ✗ | int ref = sl->ref_cache[list][scan8[i]]; | |
| 295 | ✗ | if (ref >= 0) | |
| 296 | ✗ | fill_rectangle(&sl->ref_cache[list][scan8[i]], 2, 2, | |
| 297 | ✗ | 8, (16 + ref) ^ (sl->mb_y & 1), 1); | |
| 298 | } | ||
| 299 | } | ||
| 300 | } | ||
| 301 | } | ||
| 302 | } else { | ||
| 303 | 385316 | linesize = sl->mb_linesize = sl->mb_uvlinesize = sl->linesize; | |
| 304 | } | ||
| 305 | |||
| 306 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 132592 times.
|
265184 | if (!SIMPLE && IS_INTRA_PCM(mb_type)) { |
| 307 | ✗ | if (PIXEL_SHIFT) { | |
| 308 | ✗ | const int bit_depth = h->ps.sps->bit_depth_luma; | |
| 309 | GetBitContext gb; | ||
| 310 | ✗ | init_get_bits(&gb, sl->intra_pcm_ptr, 768 * bit_depth); | |
| 311 | |||
| 312 | ✗ | for (p = 0; p < plane_count; p++) | |
| 313 | ✗ | for (i = 0; i < 16; i++) { | |
| 314 | ✗ | uint16_t *tmp = (uint16_t *)(dest[p] + i * linesize); | |
| 315 | ✗ | for (j = 0; j < 16; j++) | |
| 316 | ✗ | tmp[j] = get_bits(&gb, bit_depth); | |
| 317 | } | ||
| 318 | } else { | ||
| 319 | ✗ | for (p = 0; p < plane_count; p++) | |
| 320 | ✗ | for (i = 0; i < 16; i++) | |
| 321 | ✗ | memcpy(dest[p] + i * linesize, | |
| 322 | ✗ | sl->intra_pcm_ptr + p * 256 + i * 16, 16); | |
| 323 | } | ||
| 324 | } else { | ||
| 325 |
2/2✓ Branch 0 taken 66434 times.
✓ Branch 1 taken 126224 times.
|
385316 | if (IS_INTRA(mb_type)) { |
| 326 |
2/2✓ Branch 0 taken 61820 times.
✓ Branch 1 taken 4614 times.
|
132868 | if (sl->deblocking_filter) |
| 327 | 123640 | xchg_mb_border(h, sl, dest[0], dest[1], dest[2], linesize, | |
| 328 | 3508 | linesize, 1, 1, SIMPLE, PIXEL_SHIFT); | |
| 329 | |||
| 330 |
2/2✓ Branch 0 taken 199302 times.
✓ Branch 1 taken 66434 times.
|
531472 | for (p = 0; p < plane_count; p++) |
| 331 | 398604 | hl_decode_mb_predict_luma(h, sl, mb_type, SIMPLE, | |
| 332 | 38208 | transform_bypass, PIXEL_SHIFT, | |
| 333 | block_offset, linesize, dest[p], p); | ||
| 334 | |||
| 335 |
2/2✓ Branch 0 taken 61820 times.
✓ Branch 1 taken 4614 times.
|
132868 | if (sl->deblocking_filter) |
| 336 | 123640 | xchg_mb_border(h, sl, dest[0], dest[1], dest[2], linesize, | |
| 337 | 3508 | linesize, 0, 1, SIMPLE, PIXEL_SHIFT); | |
| 338 | } else { | ||
| 339 | 252448 | FUNC(hl_motion_444)(h, sl, dest[0], dest[1], dest[2], | |
| 340 | 252448 | h->h264qpel.put_h264_qpel_pixels_tab, | |
| 341 | 252448 | h->h264chroma.put_h264_chroma_pixels_tab, | |
| 342 | 252448 | h->h264qpel.avg_h264_qpel_pixels_tab, | |
| 343 | 252448 | h->h264chroma.avg_h264_chroma_pixels_tab, | |
| 344 | 252448 | h->h264dsp.weight_h264_pixels_tab, | |
| 345 | 252448 | h->h264dsp.biweight_h264_pixels_tab); | |
| 346 | } | ||
| 347 | |||
| 348 |
2/2✓ Branch 0 taken 577974 times.
✓ Branch 1 taken 192658 times.
|
1541264 | for (p = 0; p < plane_count; p++) |
| 349 | 1155948 | hl_decode_mb_idct_luma(h, sl, mb_type, SIMPLE, transform_bypass, | |
| 350 | 795552 | PIXEL_SHIFT, block_offset, linesize, | |
| 351 | dest[p], p); | ||
| 352 | } | ||
| 353 | 385316 | } | |
| 354 | |||
| 355 | #endif | ||
| 356 |