forge
Explore
Log in

Don't you dare go Hollow

The intrabc gate counters are read only from the cfg(test) gates

Browse files at this commit

424184726a687765936ddc4d155e0eb2dc453cabAhmet Kaan GümüşParent: 331a966
  • chore
    • the intrabc gate counters are read only from the cfg(test) gates
Show full message
chore(av1): the intrabc gate counters are read only from the cfg(test) gates
crates/ec-av1/src/encode.rsmodified+3 -0
@@ -740,6 +740,7 @@ thread_local! {
740 }740 }
741 741
742 /// [`IBC_SHARE`] for the last key frame encoded on this thread.742 /// [`IBC_SHARE`] for the last key frame encoded on this thread.
743+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
743 pub(crate) fn intrabc_source_share() -> f64 {744 pub(crate) fn intrabc_source_share() -> f64 {
744 IBC_SHARE.with(std::cell::Cell::get)745 IBC_SHARE.with(std::cell::Cell::get)
745 }746 }
@@ -2511,6 +2512,7 @@ thread_local! {
2511 static INTRABC_FORCE: std::cell::Cell<Option<bool>> = const { std::cell::Cell::new(None) };2512 static INTRABC_FORCE: std::cell::Cell<Option<bool>> = const { std::cell::Cell::new(None) };
2512 }2513 }
2513 2514
2515+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2514 pub(crate) fn force_intrabc(value: Option<bool>) {2516 pub(crate) fn force_intrabc(value: Option<bool>) {
2515 INTRABC_FORCE.with(|c| c.set(value));2517 INTRABC_FORCE.with(|c| c.set(value));
2516 }2518 }
@@ -2723,6 +2725,7 @@ impl Drop for Ibc {
2723 2725
2724 /// Reads [`IBC_SEARCH`] and zeroes it, so a gate can attribute the counts to2726 /// Reads [`IBC_SEARCH`] and zeroes it, so a gate can attribute the counts to
2725 /// its own encode.2727 /// its own encode.
2728+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
2726 pub(crate) fn take_intrabc_search() -> [usize; 3] {2729 pub(crate) fn take_intrabc_search() -> [usize; 3] {
2727 std::array::from_fn(|i| IBC_SEARCH[i].swap(0, std::sync::atomic::Ordering::Relaxed))2730 std::array::from_fn(|i| IBC_SEARCH[i].swap(0, std::sync::atomic::Ordering::Relaxed))
2728 }2731 }
crates/ec-av1/src/tile.rsmodified+1 -0
@@ -357,6 +357,7 @@ fn note_intrabc(dv: (i32, i32)) {
357 357
358 /// Reads [`INTRABC_HITS`] and zeroes it, so a gate can attribute the counts358 /// Reads [`INTRABC_HITS`] and zeroes it, so a gate can attribute the counts
359 /// to its own encode.359 /// to its own encode.
360+#[allow(dead_code)] // read only from the `#[cfg(test)]` gates
360 pub(crate) fn take_intrabc_hits() -> [usize; 7] {361 pub(crate) fn take_intrabc_hits() -> [usize; 7] {
361 std::array::from_fn(|i| INTRABC_HITS[i].swap(0, std::sync::atomic::Ordering::Relaxed))362 std::array::from_fn(|i| INTRABC_HITS[i].swap(0, std::sync::atomic::Ordering::Relaxed))
362 }363 }