Skip to content

Commit

Permalink
Do not pass ac when it is not needed
Browse files Browse the repository at this point in the history
It is used only when doing CFL.

Addresses #3257.
  • Loading branch information
lu-zero committed Sep 30, 2023
1 parent 21bb4cb commit d931220
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2285,7 +2285,7 @@ pub fn write_tx_blocks<T: Pixel, W: Writer>(
po,
skip,
qidx,
&ac.data,
&[],
IntraParam::AngleDelta(angle_delta.y),
rdo_type,
need_recon_pixel,
Expand Down Expand Up @@ -2322,9 +2322,12 @@ pub fn write_tx_blocks<T: Pixel, W: Writer>(
bw_uv /= uv_tx_size.width_mi();
bh_uv /= uv_tx_size.height_mi();

if chroma_mode.is_cfl() {
let ac_data = if chroma_mode.is_cfl() {
luma_ac(&mut ac.data, ts, tile_bo, bsize, tx_size, fi);
}
&ac.data[..]
} else {
&[]
};

let uv_tx_type = if uv_tx_size.width() >= 32 || uv_tx_size.height() >= 32 {
TxType::DCT_DCT
Expand Down Expand Up @@ -2371,7 +2374,7 @@ pub fn write_tx_blocks<T: Pixel, W: Writer>(
po,
skip,
qidx,
&ac.data,
ac_data,
if chroma_mode.is_cfl() {
IntraParam::Alpha(alpha)
} else {
Expand Down

0 comments on commit d931220

Please sign in to comment.