| @@ -71,7 +71,7 @@ static void pic_arrays_free(HEVCContext *s, HEVCLayerContext *l) · 70 unmodified lines |
| 71 | 71 | av_freep(&l->sao); |
| 72 | 72 | av_freep(&l->deblock); |
| 73 | 73 | |
| 74 | | − av_freep(&s->skip_flag); |
| 74 | + av_freep(&l->skip_flag); |
| 75 | 75 | av_freep(&s->tab_ct_depth); |
| 76 | 76 | |
| 77 | 77 | av_freep(&s->tab_ipm); |
| @@ -108,9 +108,9 @@ static int pic_arrays_init(HEVCContext *s, HEVCLayerContext *l, const HEVCSPS *s · 30 unmodified lines |
| 108 | 108 | if (!l->sao || !l->deblock) |
| 109 | 109 | goto fail; |
| 110 | 110 | |
| 111 | | − s->skip_flag = av_malloc_array(sps->min_cb_height, sps->min_cb_width); |
| 111 | + l->skip_flag = av_malloc_array(sps->min_cb_height, sps->min_cb_width); |
| 112 | 112 | s->tab_ct_depth = av_malloc_array(sps->min_cb_height, sps->min_cb_width); |
| 113 | | − if (!s->skip_flag || !s->tab_ct_depth) |
| 113 | + if (!l->skip_flag || !s->tab_ct_depth) |
| 114 | 114 | goto fail; |
| 115 | 115 | |
| 116 | 116 | s->cbf_luma = av_malloc_array(sps->min_tb_width, sps->min_tb_height); |
| @@ -1882,6 +1882,7 @@ static void hevc_luma_mv_mvp_mode(HEVCLocalContext *lc, · 1765 unmodified lines |
| 1882 | 1882 | } |
| 1883 | 1883 | |
| 1884 | 1884 | static void hls_prediction_unit(HEVCLocalContext *lc, |
| 1885 | + const HEVCLayerContext *l, |
| 1885 | 1886 | const HEVCPPS *pps, const HEVCSPS *sps, |
| 1886 | 1887 | int x0, int y0, int nPbW, int nPbH, |
| 1887 | 1888 | int log2_cb_size, int partIdx, int idx) |
| @@ -1909,7 +1910,7 @@ static void hls_prediction_unit(HEVCLocalContext *lc, · 21 unmodified lines |
| 1909 | 1910 | int x_pu, y_pu; |
| 1910 | 1911 | int i, j; |
| 1911 | 1912 | |
| 1912 | | − int skip_flag = SAMPLE_CTB(s->skip_flag, x_cb, y_cb); |
| 1913 | + int skip_flag = SAMPLE_CTB(l->skip_flag, x_cb, y_cb); |
| 1913 | 1914 | |
| 1914 | 1915 | if (!skip_flag) |
| 1915 | 1916 | lc->pu.merge_flag = ff_hevc_merge_flag_decode(lc); |
| @@ -2221,7 +2222,7 @@ static int hls_coding_unit(HEVCLocalContext *lc, const HEVCContext *s, · 305 unmodified lines |
| 2221 | 2222 | lc->cu.part_mode = PART_2Nx2N; |
| 2222 | 2223 | lc->cu.intra_split_flag = 0; |
| 2223 | 2224 | |
| 2224 | | − SAMPLE_CTB(s->skip_flag, x_cb, y_cb) = 0; |
| 2225 | + SAMPLE_CTB(l->skip_flag, x_cb, y_cb) = 0; |
| 2225 | 2226 | for (x = 0; x < 4; x++) |
| 2226 | 2227 | lc->pu.intra_pred_mode[x] = 1; |
| 2227 | 2228 | if (pps->transquant_bypass_enable_flag) { |
| @@ -2234,25 +2235,26 @@ static int hls_coding_unit(HEVCLocalContext *lc, const HEVCContext *s, · 6 unmodified lines |
| 2234 | 2235 | if (s->sh.slice_type != HEVC_SLICE_I) { |
| 2235 | 2236 | const int x0b = av_zero_extend(x0, sps->log2_ctb_size); |
| 2236 | 2237 | const int y0b = av_zero_extend(y0, sps->log2_ctb_size); |
| 2237 | | − uint8_t skip_flag = ff_hevc_skip_flag_decode(lc, x0b, y0b, x_cb, y_cb, |
| 2238 | + uint8_t skip_flag = ff_hevc_skip_flag_decode(lc, l->skip_flag, |
| 2239 | + x0b, y0b, x_cb, y_cb, |
| 2238 | 2240 | min_cb_width); |
| 2239 | 2241 | |
| 2240 | 2242 | x = y_cb * min_cb_width + x_cb; |
| 2241 | 2243 | for (y = 0; y < length; y++) { |
| 2242 | | − memset(&s->skip_flag[x], skip_flag, length); |
| 2244 | + memset(&l->skip_flag[x], skip_flag, length); |
| 2243 | 2245 | x += min_cb_width; |
| 2244 | 2246 | } |
| 2245 | 2247 | lc->cu.pred_mode = skip_flag ? MODE_SKIP : MODE_INTER; |
| 2246 | 2248 | } else { |
| 2247 | 2249 | x = y_cb * min_cb_width + x_cb; |
| 2248 | 2250 | for (y = 0; y < length; y++) { |
| 2249 | | − memset(&s->skip_flag[x], 0, length); |
| 2251 | + memset(&l->skip_flag[x], 0, length); |
| 2250 | 2252 | x += min_cb_width; |
| 2251 | 2253 | } |
| 2252 | 2254 | } |
| 2253 | 2255 | |
| 2254 | | − if (SAMPLE_CTB(s->skip_flag, x_cb, y_cb)) { |
| 2255 | | − hls_prediction_unit(lc, pps, sps, |
| 2256 | + if (SAMPLE_CTB(l->skip_flag, x_cb, y_cb)) { |
| 2257 | + hls_prediction_unit(lc, l, pps, sps, |
| 2256 | 2258 | x0, y0, cb_size, cb_size, log2_cb_size, 0, idx); |
| 2257 | 2259 | intra_prediction_unit_default_value(lc, sps, x0, y0, log2_cb_size); |
| 2258 | 2260 | |
| @@ -2291,53 +2293,53 @@ static int hls_coding_unit(HEVCLocalContext *lc, const HEVCContext *s, · 32 unmodified lines |
| 2291 | 2293 | intra_prediction_unit_default_value(lc, sps, x0, y0, log2_cb_size); |
| 2292 | 2294 | switch (lc->cu.part_mode) { |
| 2293 | 2295 | case PART_2Nx2N: |
| 2294 | | − hls_prediction_unit(lc, pps, sps, |
| 2296 | + hls_prediction_unit(lc, l, pps, sps, |
| 2295 | 2297 | x0, y0, cb_size, cb_size, log2_cb_size, 0, idx); |
| 2296 | 2298 | break; |
| 2297 | 2299 | case PART_2NxN: |
| 2298 | | − hls_prediction_unit(lc, pps, sps, |
| 2300 | + hls_prediction_unit(lc, l, pps, sps, |
| 2299 | 2301 | x0, y0, cb_size, cb_size / 2, log2_cb_size, 0, idx); |
| 2300 | | − hls_prediction_unit(lc, pps, sps, |
| 2302 | + hls_prediction_unit(lc, l, pps, sps, |
| 2301 | 2303 | x0, y0 + cb_size / 2, cb_size, cb_size / 2, log2_cb_size, 1, idx); |
| 2302 | 2304 | break; |
| 2303 | 2305 | case PART_Nx2N: |
| 2304 | | − hls_prediction_unit(lc, pps, sps, |
| 2306 | + hls_prediction_unit(lc, l, pps, sps, |
| 2305 | 2307 | x0, y0, cb_size / 2, cb_size, log2_cb_size, 0, idx - 1); |
| 2306 | | − hls_prediction_unit(lc, pps, sps, |
| 2308 | + hls_prediction_unit(lc, l, pps, sps, |
| 2307 | 2309 | x0 + cb_size / 2, y0, cb_size / 2, cb_size, log2_cb_size, 1, idx - 1); |
| 2308 | 2310 | break; |
| 2309 | 2311 | case PART_2NxnU: |
| 2310 | | − hls_prediction_unit(lc, pps, sps, |
| 2312 | + hls_prediction_unit(lc, l, pps, sps, |
| 2311 | 2313 | x0, y0, cb_size, cb_size / 4, log2_cb_size, 0, idx); |
| 2312 | | − hls_prediction_unit(lc, pps, sps, |
| 2314 | + hls_prediction_unit(lc, l, pps, sps, |
| 2313 | 2315 | x0, y0 + cb_size / 4, cb_size, cb_size * 3 / 4, log2_cb_size, 1, idx); |
| 2314 | 2316 | break; |
| 2315 | 2317 | case PART_2NxnD: |
| 2316 | | − hls_prediction_unit(lc, pps, sps, |
| 2318 | + hls_prediction_unit(lc, l, pps, sps, |
| 2317 | 2319 | x0, y0, cb_size, cb_size * 3 / 4, log2_cb_size, 0, idx); |
| 2318 | | − hls_prediction_unit(lc, pps, sps, |
| 2320 | + hls_prediction_unit(lc, l, pps, sps, |
| 2319 | 2321 | x0, y0 + cb_size * 3 / 4, cb_size, cb_size / 4, log2_cb_size, 1, idx); |
| 2320 | 2322 | break; |
| 2321 | 2323 | case PART_nLx2N: |
| 2322 | | − hls_prediction_unit(lc, pps, sps, |
| 2324 | + hls_prediction_unit(lc, l, pps, sps, |
| 2323 | 2325 | x0, y0, cb_size / 4, cb_size, log2_cb_size, 0, idx - 2); |
| 2324 | | − hls_prediction_unit(lc, pps, sps, |
| 2326 | + hls_prediction_unit(lc, l, pps, sps, |
| 2325 | 2327 | x0 + cb_size / 4, y0, cb_size * 3 / 4, cb_size, log2_cb_size, 1, idx - 2); |
| 2326 | 2328 | break; |
| 2327 | 2329 | case PART_nRx2N: |
| 2328 | | − hls_prediction_unit(lc, pps, sps, |
| 2330 | + hls_prediction_unit(lc, l, pps, sps, |
| 2329 | 2331 | x0, y0, cb_size * 3 / 4, cb_size, log2_cb_size, 0, idx - 2); |
| 2330 | | − hls_prediction_unit(lc, pps, sps, |
| 2332 | + hls_prediction_unit(lc, l, pps, sps, |
| 2331 | 2333 | x0 + cb_size * 3 / 4, y0, cb_size / 4, cb_size, log2_cb_size, 1, idx - 2); |
| 2332 | 2334 | break; |
| 2333 | 2335 | case PART_NxN: |
| 2334 | | − hls_prediction_unit(lc, pps, sps, |
| 2336 | + hls_prediction_unit(lc, l, pps, sps, |
| 2335 | 2337 | x0, y0, cb_size / 2, cb_size / 2, log2_cb_size, 0, idx - 1); |
| 2336 | | − hls_prediction_unit(lc, pps, sps, |
| 2338 | + hls_prediction_unit(lc, l, pps, sps, |
| 2337 | 2339 | x0 + cb_size / 2, y0, cb_size / 2, cb_size / 2, log2_cb_size, 1, idx - 1); |
| 2338 | | − hls_prediction_unit(lc, pps, sps, |
| 2340 | + hls_prediction_unit(lc, l, pps, sps, |
| 2339 | 2341 | x0, y0 + cb_size / 2, cb_size / 2, cb_size / 2, log2_cb_size, 2, idx - 1); |
| 2340 | | − hls_prediction_unit(lc, pps, sps, |
| 2342 | + hls_prediction_unit(lc, l, pps, sps, |
| 2341 | 2343 | x0 + cb_size / 2, y0 + cb_size / 2, cb_size / 2, cb_size / 2, log2_cb_size, 3, idx - 1); |
| 2342 | 2344 | break; |
| 2343 | 2345 | } |