summaryrefslogtreecommitdiff
path: root/libavcodec/idctdsp.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2017-04-04 12:45:51 -0400
committerRonald S. Bultje <rsbultje@gmail.com>2017-04-06 10:03:28 -0400
commit32baeafeee4f8446c2c3720b9223ad2166ca9d30 (patch)
treeb817e4d57ea80f33e1b4a9915462e4601d06bde6 /libavcodec/idctdsp.c
parente0c205677f6b3b7dba6891724cb68bfb81e9b8d6 (diff)
jrev/xvid: hardcode use of C put/add_pixels_clamped.
This removes the last use of the ff_put/add_pixels_clamped global function pointers, and as such they are removed. This patch has a negative effect on performance on MIPS, since there's a SIMD-optimized put/add_pixels_clamped, but no xvid or jrev. From a code maintenance point of view, that is probably acceptable. Because the global function pointers are removed, this fixes the following tsan warnings when running e.g. fate-dnxhr-parse: WARNING: ThreadSanitizer: data race (pid=29917) Write of size 8 at 0x0000025b12d8 by thread T2 (mutexes: write M1543): #0 ff_idctdsp_init src/libavcodec/idctdsp.c:313 (ffmpeg+0x00000044b68e) [..] Previous write of size 8 at 0x0000025b12d8 by thread T1 (mutexes: write M1541): #0 ff_idctdsp_init src/libavcodec/idctdsp.c:313 (ffmpeg+0x00000044b68e)
Diffstat (limited to 'libavcodec/idctdsp.c')
-rw-r--r--libavcodec/idctdsp.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/libavcodec/idctdsp.c b/libavcodec/idctdsp.c
index 84dd6457bd..d596aed1a9 100644
--- a/libavcodec/idctdsp.c
+++ b/libavcodec/idctdsp.c
@@ -80,11 +80,8 @@ av_cold void ff_init_scantable_permutation(uint8_t *idct_permutation,
}
}
-void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, ptrdiff_t line_size);
-void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, ptrdiff_t line_size);
-
-static void put_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels,
- ptrdiff_t line_size)
+void ff_put_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels,
+ ptrdiff_t line_size)
{
int i;
@@ -157,8 +154,8 @@ static void put_signed_pixels_clamped_c(const int16_t *block,
}
}
-static void add_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels,
- ptrdiff_t line_size)
+void ff_add_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels,
+ ptrdiff_t line_size)
{
int i;
@@ -290,9 +287,9 @@ av_cold void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx)
}
}
- c->put_pixels_clamped = put_pixels_clamped_c;
+ c->put_pixels_clamped = ff_put_pixels_clamped_c;
c->put_signed_pixels_clamped = put_signed_pixels_clamped_c;
- c->add_pixels_clamped = add_pixels_clamped_c;
+ c->add_pixels_clamped = ff_add_pixels_clamped_c;
if (CONFIG_MPEG4_DECODER && avctx->idct_algo == FF_IDCT_XVID)
ff_xvid_idct_init(c, avctx);
@@ -310,9 +307,6 @@ av_cold void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx)
if (ARCH_MIPS)
ff_idctdsp_init_mips(c, avctx, high_bit_depth);
- ff_put_pixels_clamped = c->put_pixels_clamped;
- ff_add_pixels_clamped = c->add_pixels_clamped;
-
ff_init_scantable_permutation(c->idct_permutation,
c->perm_type);
}