* [FFmpeg-devel] [PATCH 1/5] avformat/udp: avoid warning about always false comparision
@ 2025-07-16 23:57 Kacper Michajłow
2025-07-16 23:57 ` [FFmpeg-devel] [PATCH 2/5] avcodec/sonic: remove dead code Kacper Michajłow
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Kacper Michajłow @ 2025-07-16 23:57 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Kacper Michajłow
socklen_t underlying type can be signed or unsigned depending on
platform. This is fine, just cast it to size_t before comparision.
Fixes: warning: result of comparison of unsigned expression < 0 is
always false [-Wtautological-unsigned-zero-compare]
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
---
libavformat/udp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/udp.c b/libavformat/udp.c
index 0fde3548e7..035db785c2 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -473,7 +473,7 @@ int ff_udp_set_remote_addr(URLContext *h, const struct sockaddr *dest_addr, sock
UDPContext *s = h->priv_data;
/* set the destination address */
- if (dest_addr_len < 0 || dest_addr_len > sizeof(s->dest_addr))
+ if ((size_t)dest_addr_len > sizeof(s->dest_addr))
return AVERROR(EIO);
s->dest_addr_len = dest_addr_len;
memcpy(&s->dest_addr, dest_addr, dest_addr_len);
--
2.50.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
* [FFmpeg-devel] [PATCH 2/5] avcodec/sonic: remove dead code
2025-07-16 23:57 [FFmpeg-devel] [PATCH 1/5] avformat/udp: avoid warning about always false comparision Kacper Michajłow
@ 2025-07-16 23:57 ` Kacper Michajłow
2025-07-16 23:57 ` [FFmpeg-devel] [PATCH 3/5] avcodec/sonic: move code closer to use to avoid unused warnings Kacper Michajłow
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Kacper Michajłow @ 2025-07-16 23:57 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Kacper Michajłow
This was in else branch of `#if 1` since ever. No need to keep dead code
like that, if anyone needs it they can get it from git history.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
---
libavcodec/sonic.c | 299 ---------------------------------------------
1 file changed, 299 deletions(-)
diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c
index 8b1d092ec9..acefbbdbfb 100644
--- a/libavcodec/sonic.c
+++ b/libavcodec/sonic.c
@@ -166,7 +166,6 @@ static inline av_flatten int get_symbol(RangeCoder *c, uint8_t *state, int is_si
}
}
-#if 1
static inline int intlist_write(RangeCoder *c, uint8_t *state, int *buf, int entries, int base_2_part)
{
int i;
@@ -186,274 +185,6 @@ static inline int intlist_read(RangeCoder *c, uint8_t *state, int *buf, int entr
return 1;
}
-#elif 1
-static inline int intlist_write(PutBitContext *pb, int *buf, int entries, int base_2_part)
-{
- int i;
-
- for (i = 0; i < entries; i++)
- set_se_golomb(pb, buf[i]);
-
- return 1;
-}
-
-static inline int intlist_read(GetBitContext *gb, int *buf, int entries, int base_2_part)
-{
- int i;
-
- for (i = 0; i < entries; i++)
- buf[i] = get_se_golomb(gb);
-
- return 1;
-}
-
-#else
-
-#define ADAPT_LEVEL 8
-
-static int bits_to_store(uint64_t x)
-{
- int res = 0;
-
- while(x)
- {
- res++;
- x >>= 1;
- }
- return res;
-}
-
-static void write_uint_max(PutBitContext *pb, unsigned int value, unsigned int max)
-{
- int i, bits;
-
- if (!max)
- return;
-
- bits = bits_to_store(max);
-
- for (i = 0; i < bits-1; i++)
- put_bits(pb, 1, value & (1 << i));
-
- if ( (value | (1 << (bits-1))) <= max)
- put_bits(pb, 1, value & (1 << (bits-1)));
-}
-
-static unsigned int read_uint_max(GetBitContext *gb, int max)
-{
- int i, bits, value = 0;
-
- if (!max)
- return 0;
-
- bits = bits_to_store(max);
-
- for (i = 0; i < bits-1; i++)
- if (get_bits1(gb))
- value += 1 << i;
-
- if ( (value | (1<<(bits-1))) <= max)
- if (get_bits1(gb))
- value += 1 << (bits-1);
-
- return value;
-}
-
-static int intlist_write(PutBitContext *pb, int *buf, int entries, int base_2_part)
-{
- int i, j, x = 0, low_bits = 0, max = 0;
- int step = 256, pos = 0, dominant = 0, any = 0;
- int *copy, *bits;
-
- copy = av_calloc(entries, sizeof(*copy));
- if (!copy)
- return AVERROR(ENOMEM);
-
- if (base_2_part)
- {
- int energy = 0;
-
- for (i = 0; i < entries; i++)
- energy += abs(buf[i]);
-
- low_bits = bits_to_store(energy / (entries * 2));
- if (low_bits > 15)
- low_bits = 15;
-
- put_bits(pb, 4, low_bits);
- }
-
- for (i = 0; i < entries; i++)
- {
- put_bits(pb, low_bits, abs(buf[i]));
- copy[i] = abs(buf[i]) >> low_bits;
- if (copy[i] > max)
- max = abs(copy[i]);
- }
-
- bits = av_calloc(entries*max, sizeof(*bits));
- if (!bits)
- {
- av_free(copy);
- return AVERROR(ENOMEM);
- }
-
- for (i = 0; i <= max; i++)
- {
- for (j = 0; j < entries; j++)
- if (copy[j] >= i)
- bits[x++] = copy[j] > i;
- }
-
- // store bitstream
- while (pos < x)
- {
- int steplet = step >> 8;
-
- if (pos + steplet > x)
- steplet = x - pos;
-
- for (i = 0; i < steplet; i++)
- if (bits[i+pos] != dominant)
- any = 1;
-
- put_bits(pb, 1, any);
-
- if (!any)
- {
- pos += steplet;
- step += step / ADAPT_LEVEL;
- }
- else
- {
- int interloper = 0;
-
- while (((pos + interloper) < x) && (bits[pos + interloper] == dominant))
- interloper++;
-
- // note change
- write_uint_max(pb, interloper, (step >> 8) - 1);
-
- pos += interloper + 1;
- step -= step / ADAPT_LEVEL;
- }
-
- if (step < 256)
- {
- step = 65536 / step;
- dominant = !dominant;
- }
- }
-
- // store signs
- for (i = 0; i < entries; i++)
- if (buf[i])
- put_bits(pb, 1, buf[i] < 0);
-
- av_free(bits);
- av_free(copy);
-
- return 0;
-}
-
-static int intlist_read(GetBitContext *gb, int *buf, int entries, int base_2_part)
-{
- int i, low_bits = 0, x = 0;
- int n_zeros = 0, step = 256, dominant = 0;
- int pos = 0, level = 0;
- int *bits = av_calloc(entries, sizeof(*bits));
-
- if (!bits)
- return AVERROR(ENOMEM);
-
- if (base_2_part)
- {
- low_bits = get_bits(gb, 4);
-
- if (low_bits)
- for (i = 0; i < entries; i++)
- buf[i] = get_bits(gb, low_bits);
- }
-
-// av_log(NULL, AV_LOG_INFO, "entries: %d, low bits: %d\n", entries, low_bits);
-
- while (n_zeros < entries)
- {
- int steplet = step >> 8;
-
- if (!get_bits1(gb))
- {
- for (i = 0; i < steplet; i++)
- bits[x++] = dominant;
-
- if (!dominant)
- n_zeros += steplet;
-
- step += step / ADAPT_LEVEL;
- }
- else
- {
- int actual_run = read_uint_max(gb, steplet-1);
-
-// av_log(NULL, AV_LOG_INFO, "actual run: %d\n", actual_run);
-
- for (i = 0; i < actual_run; i++)
- bits[x++] = dominant;
-
- bits[x++] = !dominant;
-
- if (!dominant)
- n_zeros += actual_run;
- else
- n_zeros++;
-
- step -= step / ADAPT_LEVEL;
- }
-
- if (step < 256)
- {
- step = 65536 / step;
- dominant = !dominant;
- }
- }
-
- // reconstruct unsigned values
- n_zeros = 0;
- for (i = 0; n_zeros < entries; i++)
- {
- while(1)
- {
- if (pos >= entries)
- {
- pos = 0;
- level += 1 << low_bits;
- }
-
- if (buf[pos] >= level)
- break;
-
- pos++;
- }
-
- if (bits[i])
- buf[pos] += 1 << low_bits;
- else
- n_zeros++;
-
- pos++;
- }
- av_free(bits);
-
- // read signs
- for (i = 0; i < entries; i++)
- if (buf[i] && get_bits1(gb))
- buf[i] = -buf[i];
-
-// av_log(NULL, AV_LOG_INFO, "zeros: %d pos: %d\n", n_zeros, pos);
-
- return 0;
-}
-#endif
static void predictor_init_state(int *k, int *state, int order)
{
@@ -476,7 +207,6 @@ static int predictor_calc_error(int *k, int *state, int order, int error)
{
int i, x = error - (unsigned)shift_down(k[order-1] * (unsigned)state[order-1], LATTICE_SHIFT);
-#if 1
int *k_ptr = &(k[order-2]),
*state_ptr = &(state[order-2]);
for (i = order-2; i >= 0; i--, k_ptr--, state_ptr--)
@@ -485,13 +215,6 @@ static int predictor_calc_error(int *k, int *state, int order, int error)
x -= (unsigned)shift_down(k_value * (unsigned)state_value, LATTICE_SHIFT);
state_ptr[1] = state_value + shift_down(k_value * (unsigned)x, LATTICE_SHIFT);
}
-#else
- for (i = order-2; i >= 0; i--)
- {
- x -= (unsigned)shift_down(k[i] * state[i], LATTICE_SHIFT);
- state[i+1] = state[i] + shift_down(k[i] * x, LATTICE_SHIFT);
- }
-#endif
// don't drift too far, to avoid overflows
if (x > (SAMPLE_FACTOR<<16)) x = (SAMPLE_FACTOR<<16);
@@ -519,7 +242,6 @@ static void modified_levinson_durbin(int *window, int window_entries,
{
int step = (i+1)*channels, k, j;
double xx = 0.0, xy = 0.0;
-#if 1
int *x_ptr = &(window[step]);
int *state_ptr = &(state[0]);
j = window_entries - step;
@@ -530,17 +252,6 @@ static void modified_levinson_durbin(int *window, int window_entries,
xx += state_value*state_value;
xy += x_value*state_value;
}
-#else
- for (j = 0; j <= (window_entries - step); j++);
- {
- double stepval = window[step+j];
- double stateval = window[j];
-// xx += (double)window[j]*(double)window[j];
-// xy += (double)window[step+j]*(double)window[j];
- xx += stateval*stateval;
- xy += stepval*stateval;
- }
-#endif
if (xx == 0.0)
k = 0;
else
@@ -554,7 +265,6 @@ static void modified_levinson_durbin(int *window, int window_entries,
out[i] = k;
k *= tap_quant[i];
-#if 1
x_ptr = &(window[step]);
state_ptr = &(state[0]);
j = window_entries - step;
@@ -565,15 +275,6 @@ static void modified_levinson_durbin(int *window, int window_entries,
*x_ptr = x_value + shift_down(k*state_value,LATTICE_SHIFT);
*state_ptr = state_value + shift_down(k*x_value, LATTICE_SHIFT);
}
-#else
- for (j=0; j <= (window_entries - step); j++)
- {
- int stepval = window[step+j];
- int stateval=state[j];
- window[step+j] += shift_down(k * stateval, LATTICE_SHIFT);
- state[j] += shift_down(k * stepval, LATTICE_SHIFT);
- }
-#endif
}
}
--
2.50.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
* [FFmpeg-devel] [PATCH 3/5] avcodec/sonic: move code closer to use to avoid unused warnings
2025-07-16 23:57 [FFmpeg-devel] [PATCH 1/5] avformat/udp: avoid warning about always false comparision Kacper Michajłow
2025-07-16 23:57 ` [FFmpeg-devel] [PATCH 2/5] avcodec/sonic: remove dead code Kacper Michajłow
@ 2025-07-16 23:57 ` Kacper Michajłow
2025-07-16 23:57 ` [FFmpeg-devel] [PATCH 4/5] swscale/lut3d: remove unused function Kacper Michajłow
2025-07-16 23:57 ` [FFmpeg-devel] [PATCH 5/5] avfilter/vaf_spectrumsynth: don't use uninitialized variable as scale Kacper Michajłow
3 siblings, 0 replies; 5+ messages in thread
From: Kacper Michajłow @ 2025-07-16 23:57 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Kacper Michajłow
Put decoding and encoding code into thier respective #if blocks.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
---
libavcodec/sonic.c | 257 +++++++++++++++++++++++----------------------
1 file changed, 129 insertions(+), 128 deletions(-)
diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c
index acefbbdbfb..08549aacfe 100644
--- a/libavcodec/sonic.c
+++ b/libavcodec/sonic.c
@@ -96,134 +96,6 @@ static inline int shift_down(int a,int b)
return (a>>b)+(a<0);
}
-static av_always_inline av_flatten void put_symbol(RangeCoder *c, uint8_t *state, int v, int is_signed, uint64_t rc_stat[256][2], uint64_t rc_stat2[32][2]){
- int i;
-
-#define put_rac(C,S,B) \
-do{\
- if(rc_stat){\
- rc_stat[*(S)][B]++;\
- rc_stat2[(S)-state][B]++;\
- }\
- put_rac(C,S,B);\
-}while(0)
-
- if(v){
- const int a= FFABS(v);
- const int e= av_log2(a);
- put_rac(c, state+0, 0);
- if(e<=9){
- for(i=0; i<e; i++){
- put_rac(c, state+1+i, 1); //1..10
- }
- put_rac(c, state+1+i, 0);
-
- for(i=e-1; i>=0; i--){
- put_rac(c, state+22+i, (a>>i)&1); //22..31
- }
-
- if(is_signed)
- put_rac(c, state+11 + e, v < 0); //11..21
- }else{
- for(i=0; i<e; i++){
- put_rac(c, state+1+FFMIN(i,9), 1); //1..10
- }
- put_rac(c, state+1+9, 0);
-
- for(i=e-1; i>=0; i--){
- put_rac(c, state+22+FFMIN(i,9), (a>>i)&1); //22..31
- }
-
- if(is_signed)
- put_rac(c, state+11 + 10, v < 0); //11..21
- }
- }else{
- put_rac(c, state+0, 1);
- }
-#undef put_rac
-}
-
-static inline av_flatten int get_symbol(RangeCoder *c, uint8_t *state, int is_signed){
- if(get_rac(c, state+0))
- return 0;
- else{
- int i, e;
- unsigned a;
- e= 0;
- while(get_rac(c, state+1 + FFMIN(e,9))){ //1..10
- e++;
- if (e > 31)
- return AVERROR_INVALIDDATA;
- }
-
- a= 1;
- for(i=e-1; i>=0; i--){
- a += a + get_rac(c, state+22 + FFMIN(i,9)); //22..31
- }
-
- e= -(is_signed && get_rac(c, state+11 + FFMIN(e, 10))); //11..21
- return (a^e)-e;
- }
-}
-
-static inline int intlist_write(RangeCoder *c, uint8_t *state, int *buf, int entries, int base_2_part)
-{
- int i;
-
- for (i = 0; i < entries; i++)
- put_symbol(c, state, buf[i], 1, NULL, NULL);
-
- return 1;
-}
-
-static inline int intlist_read(RangeCoder *c, uint8_t *state, int *buf, int entries, int base_2_part)
-{
- int i;
-
- for (i = 0; i < entries; i++)
- buf[i] = get_symbol(c, state, 1);
-
- return 1;
-}
-
-static void predictor_init_state(int *k, int *state, int order)
-{
- int i;
-
- for (i = order-2; i >= 0; i--)
- {
- int j, p, x = state[i];
-
- for (j = 0, p = i+1; p < order; j++,p++)
- {
- int tmp = x + shift_down(k[j] * (unsigned)state[p], LATTICE_SHIFT);
- state[p] += shift_down(k[j]* (unsigned)x, LATTICE_SHIFT);
- x = tmp;
- }
- }
-}
-
-static int predictor_calc_error(int *k, int *state, int order, int error)
-{
- int i, x = error - (unsigned)shift_down(k[order-1] * (unsigned)state[order-1], LATTICE_SHIFT);
-
- int *k_ptr = &(k[order-2]),
- *state_ptr = &(state[order-2]);
- for (i = order-2; i >= 0; i--, k_ptr--, state_ptr--)
- {
- int k_value = *k_ptr, state_value = *state_ptr;
- x -= (unsigned)shift_down(k_value * (unsigned)state_value, LATTICE_SHIFT);
- state_ptr[1] = state_value + shift_down(k_value * (unsigned)x, LATTICE_SHIFT);
- }
-
- // don't drift too far, to avoid overflows
- if (x > (SAMPLE_FACTOR<<16)) x = (SAMPLE_FACTOR<<16);
- if (x < -(SAMPLE_FACTOR<<16)) x = -(SAMPLE_FACTOR<<16);
-
- state[0] = x;
-
- return x;
-}
#if CONFIG_SONIC_ENCODER || CONFIG_SONIC_LS_ENCODER
// Heavily modified Levinson-Durbin algorithm which
@@ -419,6 +291,63 @@ static av_cold int sonic_encode_close(AVCodecContext *avctx)
return 0;
}
+static av_always_inline av_flatten void put_symbol(RangeCoder *c, uint8_t *state, int v, int is_signed, uint64_t rc_stat[256][2], uint64_t rc_stat2[32][2]){
+ int i;
+
+#define put_rac(C,S,B) \
+do{\
+ if(rc_stat){\
+ rc_stat[*(S)][B]++;\
+ rc_stat2[(S)-state][B]++;\
+ }\
+ put_rac(C,S,B);\
+}while(0)
+
+ if(v){
+ const int a= FFABS(v);
+ const int e= av_log2(a);
+ put_rac(c, state+0, 0);
+ if(e<=9){
+ for(i=0; i<e; i++){
+ put_rac(c, state+1+i, 1); //1..10
+ }
+ put_rac(c, state+1+i, 0);
+
+ for(i=e-1; i>=0; i--){
+ put_rac(c, state+22+i, (a>>i)&1); //22..31
+ }
+
+ if(is_signed)
+ put_rac(c, state+11 + e, v < 0); //11..21
+ }else{
+ for(i=0; i<e; i++){
+ put_rac(c, state+1+FFMIN(i,9), 1); //1..10
+ }
+ put_rac(c, state+1+9, 0);
+
+ for(i=e-1; i>=0; i--){
+ put_rac(c, state+22+FFMIN(i,9), (a>>i)&1); //22..31
+ }
+
+ if(is_signed)
+ put_rac(c, state+11 + 10, v < 0); //11..21
+ }
+ }else{
+ put_rac(c, state+0, 1);
+ }
+#undef put_rac
+}
+
+static inline int intlist_write(RangeCoder *c, uint8_t *state, int *buf, int entries, int base_2_part)
+{
+ int i;
+
+ for (i = 0; i < entries; i++)
+ put_symbol(c, state, buf[i], 1, NULL, NULL);
+
+ return 1;
+}
+
static int sonic_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
const AVFrame *frame, int *got_packet_ptr)
{
@@ -685,6 +614,78 @@ static av_cold int sonic_decode_close(AVCodecContext *avctx)
return 0;
}
+static inline av_flatten int get_symbol(RangeCoder *c, uint8_t *state, int is_signed){
+ if(get_rac(c, state+0))
+ return 0;
+ else{
+ int i, e;
+ unsigned a;
+ e= 0;
+ while(get_rac(c, state+1 + FFMIN(e,9))){ //1..10
+ e++;
+ if (e > 31)
+ return AVERROR_INVALIDDATA;
+ }
+
+ a= 1;
+ for(i=e-1; i>=0; i--){
+ a += a + get_rac(c, state+22 + FFMIN(i,9)); //22..31
+ }
+
+ e= -(is_signed && get_rac(c, state+11 + FFMIN(e, 10))); //11..21
+ return (a^e)-e;
+ }
+}
+
+static inline int intlist_read(RangeCoder *c, uint8_t *state, int *buf, int entries, int base_2_part)
+{
+ int i;
+
+ for (i = 0; i < entries; i++)
+ buf[i] = get_symbol(c, state, 1);
+
+ return 1;
+}
+
+static void predictor_init_state(int *k, int *state, int order)
+{
+ int i;
+
+ for (i = order-2; i >= 0; i--)
+ {
+ int j, p, x = state[i];
+
+ for (j = 0, p = i+1; p < order; j++,p++)
+ {
+ int tmp = x + shift_down(k[j] * (unsigned)state[p], LATTICE_SHIFT);
+ state[p] += shift_down(k[j]* (unsigned)x, LATTICE_SHIFT);
+ x = tmp;
+ }
+ }
+}
+
+static int predictor_calc_error(int *k, int *state, int order, int error)
+{
+ int i, x = error - (unsigned)shift_down(k[order-1] * (unsigned)state[order-1], LATTICE_SHIFT);
+
+ int *k_ptr = &(k[order-2]),
+ *state_ptr = &(state[order-2]);
+ for (i = order-2; i >= 0; i--, k_ptr--, state_ptr--)
+ {
+ int k_value = *k_ptr, state_value = *state_ptr;
+ x -= (unsigned)shift_down(k_value * (unsigned)state_value, LATTICE_SHIFT);
+ state_ptr[1] = state_value + shift_down(k_value * (unsigned)x, LATTICE_SHIFT);
+ }
+
+ // don't drift too far, to avoid overflows
+ if (x > (SAMPLE_FACTOR<<16)) x = (SAMPLE_FACTOR<<16);
+ if (x < -(SAMPLE_FACTOR<<16)) x = -(SAMPLE_FACTOR<<16);
+
+ state[0] = x;
+
+ return x;
+}
+
static int sonic_decode_frame(AVCodecContext *avctx, AVFrame *frame,
int *got_frame_ptr, AVPacket *avpkt)
{
--
2.50.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
* [FFmpeg-devel] [PATCH 4/5] swscale/lut3d: remove unused function
2025-07-16 23:57 [FFmpeg-devel] [PATCH 1/5] avformat/udp: avoid warning about always false comparision Kacper Michajłow
2025-07-16 23:57 ` [FFmpeg-devel] [PATCH 2/5] avcodec/sonic: remove dead code Kacper Michajłow
2025-07-16 23:57 ` [FFmpeg-devel] [PATCH 3/5] avcodec/sonic: move code closer to use to avoid unused warnings Kacper Michajłow
@ 2025-07-16 23:57 ` Kacper Michajłow
2025-07-16 23:57 ` [FFmpeg-devel] [PATCH 5/5] avfilter/vaf_spectrumsynth: don't use uninitialized variable as scale Kacper Michajłow
3 siblings, 0 replies; 5+ messages in thread
From: Kacper Michajłow @ 2025-07-16 23:57 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Kacper Michajłow
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
---
libswscale/lut3d.c | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/libswscale/lut3d.c b/libswscale/lut3d.c
index f42958cd92..535694e61c 100644
--- a/libswscale/lut3d.c
+++ b/libswscale/lut3d.c
@@ -131,19 +131,6 @@ static av_always_inline v3u16_t lookup_input16(const SwsLut3D *lut3d, v3u16_t rg
return tetrahedral(lut3d, Rx, Gx, Bx, Rf, Gf, Bf);
}
-static av_always_inline v3u16_t lookup_input8(const SwsLut3D *lut3d, v3u8_t rgb)
-{
- static_assert(INPUT_LUT_BITS <= 8, "INPUT_LUT_BITS must be <= 8");
- const int shift = 8 - INPUT_LUT_BITS;
- const int Rx = rgb.x >> shift;
- const int Gx = rgb.y >> shift;
- const int Bx = rgb.z >> shift;
- const int Rf = rgb.x & ((1 << shift) - 1);
- const int Gf = rgb.y & ((1 << shift) - 1);
- const int Bf = rgb.z & ((1 << shift) - 1);
- return tetrahedral(lut3d, Rx, Gx, Bx, Rf, Gf, Bf);
-}
-
/**
* Note: These functions are scaled such that x == (1 << shift) corresponds to
* a value of 1.0. This makes them suitable for use when interpolation LUT
--
2.50.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
* [FFmpeg-devel] [PATCH 5/5] avfilter/vaf_spectrumsynth: don't use uninitialized variable as scale
2025-07-16 23:57 [FFmpeg-devel] [PATCH 1/5] avformat/udp: avoid warning about always false comparision Kacper Michajłow
` (2 preceding siblings ...)
2025-07-16 23:57 ` [FFmpeg-devel] [PATCH 4/5] swscale/lut3d: remove unused function Kacper Michajłow
@ 2025-07-16 23:57 ` Kacper Michajłow
3 siblings, 0 replies; 5+ messages in thread
From: Kacper Michajłow @ 2025-07-16 23:57 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Kacper Michajłow
scale was never initialized. av_tx_init() will use default scale if we
pass NULL.
Fixes: b3117f376d1c50b3c39befe27cbba12d5c0f80da
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
---
libavfilter/vaf_spectrumsynth.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavfilter/vaf_spectrumsynth.c b/libavfilter/vaf_spectrumsynth.c
index a2f797ec6f..04d354d504 100644
--- a/libavfilter/vaf_spectrumsynth.c
+++ b/libavfilter/vaf_spectrumsynth.c
@@ -149,7 +149,7 @@ static int config_output(AVFilterLink *outlink)
int height = ctx->inputs[0]->h;
AVRational time_base = ctx->inputs[0]->time_base;
AVRational frame_rate = inl0->frame_rate;
- float factor, overlap, scale;
+ float factor, overlap;
int i, ch, ret;
outlink->sample_rate = s->sample_rate;
@@ -184,7 +184,7 @@ static int config_output(AVFilterLink *outlink)
s->win_size = s->size * 2;
s->nb_freq = s->size;
- ret = av_tx_init(&s->fft, &s->tx_fn, AV_TX_FLOAT_FFT, 1, s->win_size, &scale, 0);
+ ret = av_tx_init(&s->fft, &s->tx_fn, AV_TX_FLOAT_FFT, 1, s->win_size, NULL, 0);
if (ret < 0) {
av_log(ctx, AV_LOG_ERROR, "Unable to create FFT context. "
"The window size might be too high.\n");
--
2.50.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-07-16 23:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-16 23:57 [FFmpeg-devel] [PATCH 1/5] avformat/udp: avoid warning about always false comparision Kacper Michajłow
2025-07-16 23:57 ` [FFmpeg-devel] [PATCH 2/5] avcodec/sonic: remove dead code Kacper Michajłow
2025-07-16 23:57 ` [FFmpeg-devel] [PATCH 3/5] avcodec/sonic: move code closer to use to avoid unused warnings Kacper Michajłow
2025-07-16 23:57 ` [FFmpeg-devel] [PATCH 4/5] swscale/lut3d: remove unused function Kacper Michajłow
2025-07-16 23:57 ` [FFmpeg-devel] [PATCH 5/5] avfilter/vaf_spectrumsynth: don't use uninitialized variable as scale Kacper Michajłow
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git