Skip to content

Commit 4973bb6

Browse files
committed
swscale/cms,graph,lut3d: Use ff_-prefix, don't export internal functions
Symbols with the sws_* prefix are exported. Reviewed-by: Alexander Strasser <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
1 parent 0bc1d2f commit 4973bb6

File tree

8 files changed

+81
-81
lines changed

8 files changed

+81
-81
lines changed

libswscale/cms.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "libswscale/swscale.h"
3232
#include "utils.h"
3333

34-
bool sws_color_map_noop(const SwsColorMap *map)
34+
bool ff_sws_color_map_noop(const SwsColorMap *map)
3535
{
3636
/* If the encoding space is different, we must go through a conversion */
3737
if (map->src.prim != map->dst.prim || map->src.trc != map->dst.trc)
@@ -676,14 +676,14 @@ static void generate_slice(void *priv, int jobnr, int threadnr, int nb_jobs,
676676
}
677677
}
678678

679-
int sws_color_map_generate_static(v3u16_t *lut, int size, const SwsColorMap *map)
679+
int ff_sws_color_map_generate_static(v3u16_t *lut, int size, const SwsColorMap *map)
680680
{
681-
return sws_color_map_generate_dynamic(lut, NULL, size, 1, 1, map);
681+
return ff_sws_color_map_generate_dynamic(lut, NULL, size, 1, 1, map);
682682
}
683683

684-
int sws_color_map_generate_dynamic(v3u16_t *input, v3u16_t *output,
685-
int size_input, int size_I, int size_PT,
686-
const SwsColorMap *map)
684+
int ff_sws_color_map_generate_dynamic(v3u16_t *input, v3u16_t *output,
685+
int size_input, int size_I, int size_PT,
686+
const SwsColorMap *map)
687687
{
688688
AVSliceThread *slicethread;
689689
int ret, num_slices;
@@ -740,7 +740,7 @@ int sws_color_map_generate_dynamic(v3u16_t *input, v3u16_t *output,
740740
return 0;
741741
}
742742

743-
void sws_tone_map_generate(v2u16_t *lut, int size, const SwsColorMap *map)
743+
void ff_sws_tone_map_generate(v2u16_t *lut, int size, const SwsColorMap *map)
744744
{
745745
CmsCtx ctx = {
746746
.map = *map,

libswscale/cms.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,27 +67,27 @@ typedef struct SwsColorMap {
6767
* Returns true if the given color map is a semantic no-op - that is,
6868
* the overall RGB end to end transform would an identity mapping.
6969
*/
70-
bool sws_color_map_noop(const SwsColorMap *map);
70+
bool ff_sws_color_map_noop(const SwsColorMap *map);
7171

7272
/**
7373
* Generates a single end-to-end color mapping 3DLUT embedding a static tone
7474
* mapping curve.
7575
*
7676
* Returns 0 on success, or a negative error code on failure.
7777
*/
78-
int sws_color_map_generate_static(v3u16_t *lut, int size, const SwsColorMap *map);
78+
int ff_sws_color_map_generate_static(v3u16_t *lut, int size, const SwsColorMap *map);
7979

8080
/**
8181
* Generates a split pair of 3DLUTS, going to IPT and back, allowing an
8282
* arbitrary dynamic EETF to be nestled in between these two operations.
8383
*
84-
* See sws_tone_map_generate().
84+
* See ff_sws_tone_map_generate().
8585
*
8686
* Returns 0 on success, or a negative error code on failure.
8787
*/
88-
int sws_color_map_generate_dynamic(v3u16_t *input, v3u16_t *output,
89-
int size_input, int size_I, int size_PT,
90-
const SwsColorMap *map);
88+
int ff_sws_color_map_generate_dynamic(v3u16_t *input, v3u16_t *output,
89+
int size_input, int size_I, int size_PT,
90+
const SwsColorMap *map);
9191

9292
/**
9393
* Generate a 1D LUT of size `size` adapting intensity (I) levels from the
@@ -100,6 +100,6 @@ int sws_color_map_generate_dynamic(v3u16_t *input, v3u16_t *output,
100100
*
101101
* Returns 0 on success, or a negative error code on failure.
102102
*/
103-
void sws_tone_map_generate(v2u16_t *lut, int size, const SwsColorMap *map);
103+
void ff_sws_tone_map_generate(v2u16_t *lut, int size, const SwsColorMap *map);
104104

105105
#endif // SWSCALE_GAMUT_MAPPING_H

libswscale/graph.c

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -472,15 +472,15 @@ static int add_legacy_sws_pass(SwsGraph *graph, SwsFormat src, SwsFormat dst,
472472
static void free_lut3d(void *priv)
473473
{
474474
SwsLut3D *lut = priv;
475-
sws_lut3d_free(&lut);
475+
ff_sws_lut3d_free(&lut);
476476
}
477477

478478
static void setup_lut3d(const SwsImg *out, const SwsImg *in, const SwsPass *pass)
479479
{
480480
SwsLut3D *lut = pass->priv;
481481

482482
/* Update dynamic frame metadata from the original source frame */
483-
sws_lut3d_update(lut, &pass->graph->src.color);
483+
ff_sws_lut3d_update(lut, &pass->graph->src.color);
484484
}
485485

486486
static void run_lut3d(const SwsImg *out_base, const SwsImg *in_base,
@@ -490,8 +490,8 @@ static void run_lut3d(const SwsImg *out_base, const SwsImg *in_base,
490490
const SwsImg in = shift_img(in_base, y);
491491
const SwsImg out = shift_img(out_base, y);
492492

493-
sws_lut3d_apply(lut, in.data[0], in.linesize[0], out.data[0],
494-
out.linesize[0], pass->width, h);
493+
ff_sws_lut3d_apply(lut, in.data[0], in.linesize[0], out.data[0],
494+
out.linesize[0], pass->width, h);
495495
}
496496

497497
static int adapt_colors(SwsGraph *graph, SwsFormat src, SwsFormat dst,
@@ -522,15 +522,15 @@ static int adapt_colors(SwsGraph *graph, SwsFormat src, SwsFormat dst,
522522
map.src = src.color;
523523
map.dst = dst.color;
524524

525-
if (sws_color_map_noop(&map))
525+
if (ff_sws_color_map_noop(&map))
526526
return 0;
527527

528-
lut = sws_lut3d_alloc();
528+
lut = ff_sws_lut3d_alloc();
529529
if (!lut)
530530
return AVERROR(ENOMEM);
531531

532-
fmt_in = sws_lut3d_pick_pixfmt(src, 0);
533-
fmt_out = sws_lut3d_pick_pixfmt(dst, 1);
532+
fmt_in = ff_sws_lut3d_pick_pixfmt(src, 0);
533+
fmt_out = ff_sws_lut3d_pick_pixfmt(dst, 1);
534534
if (fmt_in != src.format) {
535535
SwsFormat tmp = src;
536536
tmp.format = fmt_in;
@@ -539,16 +539,16 @@ static int adapt_colors(SwsGraph *graph, SwsFormat src, SwsFormat dst,
539539
return ret;
540540
}
541541

542-
ret = sws_lut3d_generate(lut, fmt_in, fmt_out, &map);
542+
ret = ff_sws_lut3d_generate(lut, fmt_in, fmt_out, &map);
543543
if (ret < 0) {
544-
sws_lut3d_free(&lut);
544+
ff_sws_lut3d_free(&lut);
545545
return ret;
546546
}
547547

548548
pass = pass_add(graph, lut, fmt_out, src.width, src.height,
549549
input, 1, run_lut3d);
550550
if (!pass) {
551-
sws_lut3d_free(&lut);
551+
ff_sws_lut3d_free(&lut);
552552
return AVERROR(ENOMEM);
553553
}
554554
pass->setup = setup_lut3d;
@@ -607,8 +607,8 @@ static void sws_graph_worker(void *priv, int jobnr, int threadnr, int nb_jobs,
607607
pass->run(output, input, slice_y, slice_h, pass);
608608
}
609609

610-
int sws_graph_create(SwsContext *ctx, const SwsFormat *dst, const SwsFormat *src,
611-
int field, SwsGraph **out_graph)
610+
int ff_sws_graph_create(SwsContext *ctx, const SwsFormat *dst, const SwsFormat *src,
611+
int field, SwsGraph **out_graph)
612612
{
613613
int ret;
614614
SwsGraph *graph = av_mallocz(sizeof(*graph));
@@ -641,11 +641,11 @@ int sws_graph_create(SwsContext *ctx, const SwsFormat *dst, const SwsFormat *src
641641
return 0;
642642

643643
error:
644-
sws_graph_free(&graph);
644+
ff_sws_graph_free(&graph);
645645
return ret;
646646
}
647647

648-
void sws_graph_free(SwsGraph **pgraph)
648+
void ff_sws_graph_free(SwsGraph **pgraph)
649649
{
650650
SwsGraph *graph = *pgraph;
651651
if (!graph)
@@ -684,34 +684,34 @@ static int opts_equal(const SwsContext *c1, const SwsContext *c2)
684684

685685
}
686686

687-
int sws_graph_reinit(SwsContext *ctx, const SwsFormat *dst, const SwsFormat *src,
688-
int field, SwsGraph **out_graph)
687+
int ff_sws_graph_reinit(SwsContext *ctx, const SwsFormat *dst, const SwsFormat *src,
688+
int field, SwsGraph **out_graph)
689689
{
690690
SwsGraph *graph = *out_graph;
691691
if (graph && ff_fmt_equal(&graph->src, src) &&
692692
ff_fmt_equal(&graph->dst, dst) &&
693693
opts_equal(ctx, &graph->opts_copy))
694694
{
695-
sws_graph_update_metadata(graph, &src->color);
695+
ff_sws_graph_update_metadata(graph, &src->color);
696696
return 0;
697697
}
698698

699-
sws_graph_free(out_graph);
700-
return sws_graph_create(ctx, dst, src, field, out_graph);
699+
ff_sws_graph_free(out_graph);
700+
return ff_sws_graph_create(ctx, dst, src, field, out_graph);
701701
}
702702

703-
void sws_graph_update_metadata(SwsGraph *graph, const SwsColor *color)
703+
void ff_sws_graph_update_metadata(SwsGraph *graph, const SwsColor *color)
704704
{
705705
if (!color)
706706
return;
707707

708708
ff_color_update_dynamic(&graph->src.color, color);
709709
}
710710

711-
void sws_graph_run(SwsGraph *graph, uint8_t *const out_data[4],
712-
const int out_linesize[4],
713-
const uint8_t *const in_data[4],
714-
const int in_linesize[4])
711+
void ff_sws_graph_run(SwsGraph *graph, uint8_t *const out_data[4],
712+
const int out_linesize[4],
713+
const uint8_t *const in_data[4],
714+
const int in_linesize[4])
715715
{
716716
SwsImg *out = &graph->exec.output;
717717
SwsImg *in = &graph->exec.input;

libswscale/graph.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ typedef struct SwsGraph {
114114
SwsFormat src, dst;
115115
int field;
116116

117-
/** Temporary execution state inside sws_graph_run */
117+
/** Temporary execution state inside ff_sws_graph_run */
118118
struct {
119119
const SwsPass *pass; /* current filter pass */
120120
SwsImg input;
@@ -125,34 +125,34 @@ typedef struct SwsGraph {
125125
/**
126126
* Allocate and initialize the filter graph. Returns 0 or a negative error.
127127
*/
128-
int sws_graph_create(SwsContext *ctx, const SwsFormat *dst, const SwsFormat *src,
129-
int field, SwsGraph **out_graph);
128+
int ff_sws_graph_create(SwsContext *ctx, const SwsFormat *dst, const SwsFormat *src,
129+
int field, SwsGraph **out_graph);
130130

131131
/**
132132
* Uninitialize any state associate with this filter graph and free it.
133133
*/
134-
void sws_graph_free(SwsGraph **graph);
134+
void ff_sws_graph_free(SwsGraph **graph);
135135

136136
/**
137137
* Update dynamic per-frame HDR metadata without requiring a full reinit.
138138
*/
139-
void sws_graph_update_metadata(SwsGraph *graph, const SwsColor *color);
139+
void ff_sws_graph_update_metadata(SwsGraph *graph, const SwsColor *color);
140140

141141
/**
142-
* Wrapper around sws_graph_create() that reuses the existing graph if the
142+
* Wrapper around ff_sws_graph_create() that reuses the existing graph if the
143143
* format is compatible. This will also update dynamic per-frame metadata.
144144
* Must be called after changing any of the fields in `ctx`, or else they will
145145
* have no effect.
146146
*/
147-
int sws_graph_reinit(SwsContext *ctx, const SwsFormat *dst, const SwsFormat *src,
148-
int field, SwsGraph **graph);
147+
int ff_sws_graph_reinit(SwsContext *ctx, const SwsFormat *dst, const SwsFormat *src,
148+
int field, SwsGraph **graph);
149149

150150
/**
151151
* Dispatch the filter graph on a single field. Internally threaded.
152152
*/
153-
void sws_graph_run(SwsGraph *graph, uint8_t *const out_data[4],
154-
const int out_linesize[4],
155-
const uint8_t *const in_data[4],
156-
const int in_linesize[4]);
153+
void ff_sws_graph_run(SwsGraph *graph, uint8_t *const out_data[4],
154+
const int out_linesize[4],
155+
const uint8_t *const in_data[4],
156+
const int in_linesize[4]);
157157

158158
#endif /* SWSCALE_GRAPH_H */

libswscale/lut3d.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include "csputils.h"
3030
#include "lut3d.h"
3131

32-
SwsLut3D *sws_lut3d_alloc(void)
32+
SwsLut3D *ff_sws_lut3d_alloc(void)
3333
{
3434
SwsLut3D *lut3d = av_malloc(sizeof(*lut3d));
3535
if (!lut3d)
@@ -39,17 +39,17 @@ SwsLut3D *sws_lut3d_alloc(void)
3939
return lut3d;
4040
}
4141

42-
void sws_lut3d_free(SwsLut3D **plut3d)
42+
void ff_sws_lut3d_free(SwsLut3D **plut3d)
4343
{
4444
av_freep(plut3d);
4545
}
4646

47-
bool sws_lut3d_test_fmt(enum AVPixelFormat fmt, int output)
47+
bool ff_sws_lut3d_test_fmt(enum AVPixelFormat fmt, int output)
4848
{
4949
return fmt == AV_PIX_FMT_RGBA64;
5050
}
5151

52-
enum AVPixelFormat sws_lut3d_pick_pixfmt(SwsFormat fmt, int output)
52+
enum AVPixelFormat ff_sws_lut3d_pick_pixfmt(SwsFormat fmt, int output)
5353
{
5454
return AV_PIX_FMT_RGBA64;
5555
}
@@ -221,47 +221,47 @@ static av_always_inline v3u16_t apply_tone_map(const SwsLut3D *lut3d, v3u16_t ip
221221
return ipt;
222222
}
223223

224-
int sws_lut3d_generate(SwsLut3D *lut3d, enum AVPixelFormat fmt_in,
225-
enum AVPixelFormat fmt_out, const SwsColorMap *map)
224+
int ff_sws_lut3d_generate(SwsLut3D *lut3d, enum AVPixelFormat fmt_in,
225+
enum AVPixelFormat fmt_out, const SwsColorMap *map)
226226
{
227227
int ret;
228228

229-
if (!sws_lut3d_test_fmt(fmt_in, 0) || !sws_lut3d_test_fmt(fmt_out, 1))
229+
if (!ff_sws_lut3d_test_fmt(fmt_in, 0) || !ff_sws_lut3d_test_fmt(fmt_out, 1))
230230
return AVERROR(EINVAL);
231231

232232
lut3d->dynamic = map->src.frame_peak.num > 0;
233233
lut3d->map = *map;
234234

235235
if (lut3d->dynamic) {
236-
ret = sws_color_map_generate_dynamic(&lut3d->input[0][0][0],
236+
ret = ff_sws_color_map_generate_dynamic(&lut3d->input[0][0][0],
237237
&lut3d->output[0][0][0],
238238
INPUT_LUT_SIZE, OUTPUT_LUT_SIZE_I,
239239
OUTPUT_LUT_SIZE_PT, map);
240240
if (ret < 0)
241241
return ret;
242242

243243
/* Make sure initial state is valid */
244-
sws_lut3d_update(lut3d, &map->src);
244+
ff_sws_lut3d_update(lut3d, &map->src);
245245
return 0;
246246
} else {
247-
return sws_color_map_generate_static(&lut3d->input[0][0][0],
247+
return ff_sws_color_map_generate_static(&lut3d->input[0][0][0],
248248
INPUT_LUT_SIZE, map);
249249
}
250250
}
251251

252-
void sws_lut3d_update(SwsLut3D *lut3d, const SwsColor *new_src)
252+
void ff_sws_lut3d_update(SwsLut3D *lut3d, const SwsColor *new_src)
253253
{
254254
if (!new_src || !lut3d->dynamic)
255255
return;
256256

257257
lut3d->map.src.frame_peak = new_src->frame_peak;
258258
lut3d->map.src.frame_avg = new_src->frame_avg;
259259

260-
sws_tone_map_generate(lut3d->tone_map, TONE_LUT_SIZE, &lut3d->map);
260+
ff_sws_tone_map_generate(lut3d->tone_map, TONE_LUT_SIZE, &lut3d->map);
261261
}
262262

263-
void sws_lut3d_apply(const SwsLut3D *lut3d, const uint8_t *in, int in_stride,
264-
uint8_t *out, int out_stride, int w, int h)
263+
void ff_sws_lut3d_apply(const SwsLut3D *lut3d, const uint8_t *in, int in_stride,
264+
uint8_t *out, int out_stride, int w, int h)
265265
{
266266
while (h--) {
267267
const uint16_t *in16 = (const uint16_t *) in;

0 commit comments

Comments
 (0)