mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
x86: Move some conditional code around to avoid unused variable warnings
This commit is contained in:
parent
10f1a4d9bd
commit
c1ad70c3cb
@ -1279,9 +1279,9 @@ void ff_vector_clip_int32_sse4 (int32_t *dst, const int32_t *src,
|
|||||||
static av_cold void dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx,
|
static av_cold void dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx,
|
||||||
int mm_flags)
|
int mm_flags)
|
||||||
{
|
{
|
||||||
|
#if HAVE_INLINE_ASM
|
||||||
const int high_bit_depth = avctx->bits_per_raw_sample > 8;
|
const int high_bit_depth = avctx->bits_per_raw_sample > 8;
|
||||||
|
|
||||||
#if HAVE_INLINE_ASM
|
|
||||||
c->put_pixels_clamped = ff_put_pixels_clamped_mmx;
|
c->put_pixels_clamped = ff_put_pixels_clamped_mmx;
|
||||||
c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_mmx;
|
c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_mmx;
|
||||||
c->add_pixels_clamped = ff_add_pixels_clamped_mmx;
|
c->add_pixels_clamped = ff_add_pixels_clamped_mmx;
|
||||||
@ -1319,26 +1319,15 @@ static av_cold void dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
c->vector_clip_int32 = ff_vector_clip_int32_mmx;
|
c->vector_clip_int32 = ff_vector_clip_int32_mmx;
|
||||||
#endif
|
#endif /* HAVE_YASM */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static av_cold void dsputil_init_mmxext(DSPContext *c, AVCodecContext *avctx,
|
static av_cold void dsputil_init_mmxext(DSPContext *c, AVCodecContext *avctx,
|
||||||
int mm_flags)
|
int mm_flags)
|
||||||
{
|
{
|
||||||
|
#if HAVE_INLINE_ASM
|
||||||
const int high_bit_depth = avctx->bits_per_raw_sample > 8;
|
const int high_bit_depth = avctx->bits_per_raw_sample > 8;
|
||||||
|
|
||||||
#if HAVE_YASM
|
|
||||||
SET_QPEL_FUNCS(avg_qpel, 0, 16, mmxext, );
|
|
||||||
SET_QPEL_FUNCS(avg_qpel, 1, 8, mmxext, );
|
|
||||||
|
|
||||||
SET_QPEL_FUNCS(put_qpel, 0, 16, mmxext, );
|
|
||||||
SET_QPEL_FUNCS(put_qpel, 1, 8, mmxext, );
|
|
||||||
SET_QPEL_FUNCS(put_no_rnd_qpel, 0, 16, mmxext, );
|
|
||||||
SET_QPEL_FUNCS(put_no_rnd_qpel, 1, 8, mmxext, );
|
|
||||||
#endif /* HAVE_YASM */
|
|
||||||
|
|
||||||
#if HAVE_INLINE_ASM
|
|
||||||
if (!high_bit_depth && avctx->idct_algo == FF_IDCT_XVIDMMX) {
|
if (!high_bit_depth && avctx->idct_algo == FF_IDCT_XVIDMMX) {
|
||||||
c->idct_put = ff_idct_xvid_mmxext_put;
|
c->idct_put = ff_idct_xvid_mmxext_put;
|
||||||
c->idct_add = ff_idct_xvid_mmxext_add;
|
c->idct_add = ff_idct_xvid_mmxext_add;
|
||||||
@ -1347,6 +1336,14 @@ static av_cold void dsputil_init_mmxext(DSPContext *c, AVCodecContext *avctx,
|
|||||||
#endif /* HAVE_INLINE_ASM */
|
#endif /* HAVE_INLINE_ASM */
|
||||||
|
|
||||||
#if HAVE_MMXEXT_EXTERNAL
|
#if HAVE_MMXEXT_EXTERNAL
|
||||||
|
SET_QPEL_FUNCS(avg_qpel, 0, 16, mmxext, );
|
||||||
|
SET_QPEL_FUNCS(avg_qpel, 1, 8, mmxext, );
|
||||||
|
|
||||||
|
SET_QPEL_FUNCS(put_qpel, 0, 16, mmxext, );
|
||||||
|
SET_QPEL_FUNCS(put_qpel, 1, 8, mmxext, );
|
||||||
|
SET_QPEL_FUNCS(put_no_rnd_qpel, 0, 16, mmxext, );
|
||||||
|
SET_QPEL_FUNCS(put_no_rnd_qpel, 1, 8, mmxext, );
|
||||||
|
|
||||||
/* slower than cmov version on AMD */
|
/* slower than cmov version on AMD */
|
||||||
if (!(mm_flags & AV_CPU_FLAG_3DNOW))
|
if (!(mm_flags & AV_CPU_FLAG_3DNOW))
|
||||||
c->add_hfyu_median_prediction = ff_add_hfyu_median_prediction_mmxext;
|
c->add_hfyu_median_prediction = ff_add_hfyu_median_prediction_mmxext;
|
||||||
@ -1383,9 +1380,9 @@ static av_cold void dsputil_init_sse(DSPContext *c, AVCodecContext *avctx,
|
|||||||
static av_cold void dsputil_init_sse2(DSPContext *c, AVCodecContext *avctx,
|
static av_cold void dsputil_init_sse2(DSPContext *c, AVCodecContext *avctx,
|
||||||
int mm_flags)
|
int mm_flags)
|
||||||
{
|
{
|
||||||
|
#if HAVE_SSE2_INLINE
|
||||||
const int high_bit_depth = avctx->bits_per_raw_sample > 8;
|
const int high_bit_depth = avctx->bits_per_raw_sample > 8;
|
||||||
|
|
||||||
#if HAVE_SSE2_INLINE
|
|
||||||
if (!high_bit_depth && avctx->idct_algo == FF_IDCT_XVIDMMX) {
|
if (!high_bit_depth && avctx->idct_algo == FF_IDCT_XVIDMMX) {
|
||||||
c->idct_put = ff_idct_xvid_sse2_put;
|
c->idct_put = ff_idct_xvid_sse2_put;
|
||||||
c->idct_add = ff_idct_xvid_sse2_add;
|
c->idct_add = ff_idct_xvid_sse2_add;
|
||||||
|
@ -946,9 +946,10 @@ hadamard_func(ssse3)
|
|||||||
av_cold void ff_dsputilenc_init_mmx(DSPContext *c, AVCodecContext *avctx)
|
av_cold void ff_dsputilenc_init_mmx(DSPContext *c, AVCodecContext *avctx)
|
||||||
{
|
{
|
||||||
int mm_flags = av_get_cpu_flags();
|
int mm_flags = av_get_cpu_flags();
|
||||||
int bit_depth = avctx->bits_per_raw_sample;
|
|
||||||
|
|
||||||
#if HAVE_YASM
|
#if HAVE_YASM
|
||||||
|
int bit_depth = avctx->bits_per_raw_sample;
|
||||||
|
|
||||||
if (EXTERNAL_MMX(mm_flags)) {
|
if (EXTERNAL_MMX(mm_flags)) {
|
||||||
if (bit_depth <= 8)
|
if (bit_depth <= 8)
|
||||||
c->get_pixels = ff_get_pixels_mmx;
|
c->get_pixels = ff_get_pixels_mmx;
|
||||||
|
@ -83,11 +83,11 @@ extern uint16_t ff_inv_zigzag_direct16[64];
|
|||||||
|
|
||||||
av_cold void ff_MPV_encode_init_x86(MpegEncContext *s)
|
av_cold void ff_MPV_encode_init_x86(MpegEncContext *s)
|
||||||
{
|
{
|
||||||
int mm_flags = av_get_cpu_flags();
|
|
||||||
const int dct_algo = s->avctx->dct_algo;
|
const int dct_algo = s->avctx->dct_algo;
|
||||||
|
|
||||||
if (dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX) {
|
if (dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX) {
|
||||||
#if HAVE_MMX_INLINE
|
#if HAVE_MMX_INLINE
|
||||||
|
int mm_flags = av_get_cpu_flags();
|
||||||
if (INLINE_MMX(mm_flags))
|
if (INLINE_MMX(mm_flags))
|
||||||
s->dct_quantize = dct_quantize_MMX;
|
s->dct_quantize = dct_quantize_MMX;
|
||||||
#endif
|
#endif
|
||||||
|
@ -200,9 +200,9 @@ static void gradfun_blur_line_sse2(uint16_t *dc, uint16_t *buf, uint16_t *buf1,
|
|||||||
|
|
||||||
av_cold void ff_gradfun_init_x86(GradFunContext *gf)
|
av_cold void ff_gradfun_init_x86(GradFunContext *gf)
|
||||||
{
|
{
|
||||||
|
#if HAVE_MMXEXT_INLINE
|
||||||
int cpu_flags = av_get_cpu_flags();
|
int cpu_flags = av_get_cpu_flags();
|
||||||
|
|
||||||
#if HAVE_MMXEXT_INLINE
|
|
||||||
if (cpu_flags & AV_CPU_FLAG_MMXEXT)
|
if (cpu_flags & AV_CPU_FLAG_MMXEXT)
|
||||||
gf->filter_line = gradfun_filter_line_mmxext;
|
gf->filter_line = gradfun_filter_line_mmxext;
|
||||||
#endif
|
#endif
|
||||||
|
@ -39,9 +39,9 @@ void ff_yadif_filter_line_ssse3(void *dst, void *prev, void *cur,
|
|||||||
|
|
||||||
av_cold void ff_yadif_init_x86(YADIFContext *yadif)
|
av_cold void ff_yadif_init_x86(YADIFContext *yadif)
|
||||||
{
|
{
|
||||||
|
#if HAVE_YASM
|
||||||
int cpu_flags = av_get_cpu_flags();
|
int cpu_flags = av_get_cpu_flags();
|
||||||
|
|
||||||
#if HAVE_YASM
|
|
||||||
#if ARCH_X86_32
|
#if ARCH_X86_32
|
||||||
if (EXTERNAL_MMXEXT(cpu_flags)) {
|
if (EXTERNAL_MMXEXT(cpu_flags)) {
|
||||||
yadif->filter_line = ff_yadif_filter_line_mmxext;
|
yadif->filter_line = ff_yadif_filter_line_mmxext;
|
||||||
|
Loading…
Reference in New Issue
Block a user