mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-27 19:24:06 +00:00
[cclm] Add bits to RD calculation
This commit is contained in:
parent
85ff5f23b1
commit
697d4c0652
|
@ -825,7 +825,19 @@ double kvz_chroma_mode_bits(const encoder_state_t *state, int8_t chroma_mode, in
|
||||||
if (chroma_mode == luma_mode) {
|
if (chroma_mode == luma_mode) {
|
||||||
mode_bits = CTX_ENTROPY_FBITS(ctx, 0);
|
mode_bits = CTX_ENTROPY_FBITS(ctx, 0);
|
||||||
} else {
|
} else {
|
||||||
mode_bits = 2.0 + CTX_ENTROPY_FBITS(ctx, 1);
|
if(chroma_mode > 67) {
|
||||||
|
mode_bits = 2.0 + CTX_ENTROPY_FBITS(ctx, 1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ctx = &(state->cabac.ctx.cclm_model);
|
||||||
|
mode_bits = CTX_ENTROPY_FBITS(ctx, chroma_mode != 81);
|
||||||
|
if (chroma_mode != 81) mode_bits += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Technically this is encoded first but for this method of counting bits it does not matter
|
||||||
|
if(state->encoder_control->cfg.cclm) {
|
||||||
|
ctx = &(state->cabac.ctx.cclm_flag);
|
||||||
|
mode_bits += CTX_ENTROPY_FBITS(ctx, chroma_mode > 67);
|
||||||
}
|
}
|
||||||
|
|
||||||
return mode_bits;
|
return mode_bits;
|
||||||
|
|
Loading…
Reference in a new issue