Lines Matching refs:vdsc_cfg

253  * @vdsc_cfg:
256 int drm_dsc_compute_rc_parameters(struct drm_dsc_config *vdsc_cfg)
266 if (vdsc_cfg->native_420 || vdsc_cfg->native_422) {
268 groups_per_line = DIV_ROUND_UP(vdsc_cfg->slice_width / 2,
272 vdsc_cfg->slice_chunk_size = DIV_ROUND_UP(vdsc_cfg->slice_width / 2 *
273 vdsc_cfg->bits_per_pixel,
277 groups_per_line = DIV_ROUND_UP(vdsc_cfg->slice_width,
281 vdsc_cfg->slice_chunk_size = DIV_ROUND_UP(vdsc_cfg->slice_width *
282 vdsc_cfg->bits_per_pixel,
286 if (vdsc_cfg->convert_rgb)
287 num_extra_mux_bits = 3 * (vdsc_cfg->mux_word_size +
288 (4 * vdsc_cfg->bits_per_component + 4)
290 else if (vdsc_cfg->native_422)
291 num_extra_mux_bits = 4 * vdsc_cfg->mux_word_size +
292 (4 * vdsc_cfg->bits_per_component + 4) +
293 3 * (4 * vdsc_cfg->bits_per_component) - 2;
295 num_extra_mux_bits = 3 * vdsc_cfg->mux_word_size +
296 (4 * vdsc_cfg->bits_per_component + 4) +
297 2 * (4 * vdsc_cfg->bits_per_component) - 2;
299 slice_bits = 8 * vdsc_cfg->slice_chunk_size * vdsc_cfg->slice_height;
302 ((slice_bits - num_extra_mux_bits) % vdsc_cfg->mux_word_size))
305 if (groups_per_line < vdsc_cfg->initial_scale_value - 8)
306 vdsc_cfg->initial_scale_value = groups_per_line + 8;
309 if (vdsc_cfg->initial_scale_value > 8)
310 vdsc_cfg->scale_decrement_interval = groups_per_line /
311 (vdsc_cfg->initial_scale_value - 8);
313 vdsc_cfg->scale_decrement_interval = DSC_SCALE_DECREMENT_INTERVAL_MAX;
315 vdsc_cfg->final_offset = vdsc_cfg->rc_model_size -
316 (vdsc_cfg->initial_xmit_delay *
317 vdsc_cfg->bits_per_pixel + 8) / 16 + num_extra_mux_bits;
319 if (vdsc_cfg->final_offset >= vdsc_cfg->rc_model_size) {
324 final_scale = (vdsc_cfg->rc_model_size * 8) /
325 (vdsc_cfg->rc_model_size - vdsc_cfg->final_offset);
326 if (vdsc_cfg->slice_height > 1)
332 vdsc_cfg->nfl_bpg_offset = DIV_ROUND_UP((vdsc_cfg->first_line_bpg_offset << 11),
333 (vdsc_cfg->slice_height - 1));
335 vdsc_cfg->nfl_bpg_offset = 0;
338 groups_total = groups_per_line * vdsc_cfg->slice_height;
341 vdsc_cfg->slice_bpg_offset = DIV_ROUND_UP(((vdsc_cfg->rc_model_size -
342 vdsc_cfg->initial_offset +
353 vdsc_cfg->scale_increment_interval =
354 (vdsc_cfg->final_offset * (1 << 11)) /
355 ((vdsc_cfg->nfl_bpg_offset +
356 vdsc_cfg->slice_bpg_offset) *
363 vdsc_cfg->scale_increment_interval = 0;
371 rbs_min = vdsc_cfg->rc_model_size - vdsc_cfg->initial_offset +
372 DIV_ROUND_UP(vdsc_cfg->initial_xmit_delay *
373 vdsc_cfg->bits_per_pixel, 16) +
374 groups_per_line * vdsc_cfg->first_line_bpg_offset;
376 hrd_delay = DIV_ROUND_UP((rbs_min * 16), vdsc_cfg->bits_per_pixel);
377 vdsc_cfg->rc_bits = (hrd_delay * vdsc_cfg->bits_per_pixel) / 16;
378 vdsc_cfg->initial_dec_delay = hrd_delay - vdsc_cfg->initial_xmit_delay;