From 9c7f28d2a6c01017bbbb55377229f40f6b533270 Mon Sep 17 00:00:00 2001
From: James Zern <[EMAIL REDACTED]>
Date: Thu, 15 Aug 2024 13:34:18 -0700
Subject: [PATCH] binary_codes_reader.c: make 2 functions static
aom_read_primitive_quniform_() and aom_read_primitive_subexpfin() are
only used in this file.
Bug: aomedia:3416
Change-Id: I058e97c082117817b2aa908f5d0a7cd73c78e0bd
---
aom_dsp/binary_codes_reader.c | 17 +++++++++++------
aom_dsp/binary_codes_reader.h | 7 -------
2 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/aom_dsp/binary_codes_reader.c b/aom_dsp/binary_codes_reader.c
index 3af1c18642..a87653278f 100644
--- a/aom_dsp/binary_codes_reader.c
+++ b/aom_dsp/binary_codes_reader.c
@@ -12,8 +12,13 @@
#include "aom_dsp/binary_codes_reader.h"
#include "aom_dsp/recenter.h"
-uint16_t aom_read_primitive_quniform_(aom_reader *r,
- uint16_t n ACCT_STR_PARAM) {
+#define read_primitive_quniform(r, n, ACCT_STR_NAME) \
+ read_primitive_quniform_(r, n ACCT_STR_ARG(ACCT_STR_NAME))
+#define read_primitive_subexpfin(r, n, k, ACCT_STR_NAME) \
+ read_primitive_subexpfin_(r, n, k ACCT_STR_ARG(ACCT_STR_NAME))
+
+static uint16_t read_primitive_quniform_(aom_reader *r,
+ uint16_t n ACCT_STR_PARAM) {
if (n <= 1) return 0;
const int l = get_msb(n) + 1;
const int m = (1 << l) - n;
@@ -23,8 +28,8 @@ uint16_t aom_read_primitive_quniform_(aom_reader *r,
// Decode finite subexponential code that for a symbol v in [0, n-1] with
// parameter k
-uint16_t aom_read_primitive_subexpfin_(aom_reader *r, uint16_t n,
- uint16_t k ACCT_STR_PARAM) {
+static uint16_t read_primitive_subexpfin_(aom_reader *r, uint16_t n,
+ uint16_t k ACCT_STR_PARAM) {
int i = 0;
int mk = 0;
@@ -33,7 +38,7 @@ uint16_t aom_read_primitive_subexpfin_(aom_reader *r, uint16_t n,
int a = (1 << b);
if (n <= mk + 3 * a) {
- return aom_read_primitive_quniform(r, n - mk, ACCT_STR_NAME) + mk;
+ return read_primitive_quniform(r, n - mk, ACCT_STR_NAME) + mk;
}
if (!aom_read_bit(r, ACCT_STR_NAME)) {
@@ -51,5 +56,5 @@ uint16_t aom_read_primitive_subexpfin_(aom_reader *r, uint16_t n,
uint16_t aom_read_primitive_refsubexpfin_(aom_reader *r, uint16_t n, uint16_t k,
uint16_t ref ACCT_STR_PARAM) {
return inv_recenter_finite_nonneg(
- n, ref, aom_read_primitive_subexpfin(r, n, k, ACCT_STR_NAME));
+ n, ref, read_primitive_subexpfin(r, n, k, ACCT_STR_NAME));
}
diff --git a/aom_dsp/binary_codes_reader.h b/aom_dsp/binary_codes_reader.h
index 8ef16eb11c..ad529a3214 100644
--- a/aom_dsp/binary_codes_reader.h
+++ b/aom_dsp/binary_codes_reader.h
@@ -24,16 +24,9 @@ extern "C" {
#include "aom_dsp/bitreader.h"
#include "aom_dsp/bitreader_buffer.h"
-#define aom_read_primitive_quniform(r, n, ACCT_STR_NAME) \
- aom_read_primitive_quniform_(r, n ACCT_STR_ARG(ACCT_STR_NAME))
-#define aom_read_primitive_subexpfin(r, n, k, ACCT_STR_NAME) \
- aom_read_primitive_subexpfin_(r, n, k ACCT_STR_ARG(ACCT_STR_NAME))
#define aom_read_primitive_refsubexpfin(r, n, k, ref, ACCT_STR_NAME) \
aom_read_primitive_refsubexpfin_(r, n, k, ref ACCT_STR_ARG(ACCT_STR_NAME))
-uint16_t aom_read_primitive_quniform_(aom_reader *r, uint16_t n ACCT_STR_PARAM);
-uint16_t aom_read_primitive_subexpfin_(aom_reader *r, uint16_t n,
- uint16_t k ACCT_STR_PARAM);
uint16_t aom_read_primitive_refsubexpfin_(aom_reader *r, uint16_t n, uint16_t k,
uint16_t ref ACCT_STR_PARAM);