mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-11-06 05:17:42 +00:00
swscale/ops_chain: remove unused SwsOp setup helpers
They were only used by the aarch64 backend, which has now been ported to uops and no longer needs them. Sponsored-by: Sovereign Tech Fund Signed-off-by: Ramiro Polla <ramiro.polla@gmail.com>
This commit is contained in:
1 parent
05ecb86e31
commit
1a48ef59d1
2 files changed
+1
-65
No files matched your search
@@ -20,7 +20,6 @@
|
||||
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/mem.h"
|
||||
#include "libavutil/rational.h"
|
||||
|
||||
#include "ops_chain.h"
|
||||
|
||||
@@ -58,61 +57,6 @@ int ff_sws_op_chain_append(SwsOpChain *chain, SwsFuncPtr func,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define q2pixel(type, q) ((q).den ? (type) (q).num / (q).den : 0)
|
||||
|
||||
#if ARCH_AARCH64
|
||||
int ff_sws_setup_scale(const SwsImplParams *params, SwsImplResult *out)
|
||||
{
|
||||
const SwsOp *op = params->op;
|
||||
const AVRational64 factor = op->scale.factor;
|
||||
switch (op->type) {
|
||||
case SWS_PIXEL_U8: out->priv.u8[0] = q2pixel(uint8_t, factor); break;
|
||||
case SWS_PIXEL_U16: out->priv.u16[0] = q2pixel(uint16_t, factor); break;
|
||||
case SWS_PIXEL_U32: out->priv.u32[0] = q2pixel(uint32_t, factor); break;
|
||||
case SWS_PIXEL_F32: out->priv.f32[0] = q2pixel(float, factor); break;
|
||||
default: return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ff_sws_setup_clamp(const SwsImplParams *params, SwsImplResult *out)
|
||||
{
|
||||
const SwsOp *op = params->op;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
const AVRational64 limit = op->clamp.limit[i];
|
||||
switch (op->type) {
|
||||
case SWS_PIXEL_U8: out->priv.u8[i] = q2pixel(uint8_t, limit); break;
|
||||
case SWS_PIXEL_U16: out->priv.u16[i] = q2pixel(uint16_t, limit); break;
|
||||
case SWS_PIXEL_U32: out->priv.u32[i] = q2pixel(uint32_t, limit); break;
|
||||
case SWS_PIXEL_F32: out->priv.f32[i] = q2pixel(float, limit); break;
|
||||
default: return AVERROR(EINVAL);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ff_sws_setup_clear(const SwsImplParams *params, SwsImplResult *out)
|
||||
{
|
||||
const SwsOp *op = params->op;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
const AVRational64 value = op->clear.value[i];
|
||||
if (!value.den)
|
||||
continue;
|
||||
switch (op->type) {
|
||||
case SWS_PIXEL_U8: out->priv.u8[i] = q2pixel(uint8_t, value); break;
|
||||
case SWS_PIXEL_U16: out->priv.u16[i] = q2pixel(uint16_t, value); break;
|
||||
case SWS_PIXEL_U32: out->priv.u32[i] = q2pixel(uint32_t, value); break;
|
||||
case SWS_PIXEL_F32: out->priv.f32[i] = q2pixel(float, value); break;
|
||||
default: return AVERROR(EINVAL);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int ff_sws_uop_lookup(SwsContext *ctx, const SwsUOpTable *const tables[],
|
||||
int num_tables, const SwsUOp *uop, const int block_size,
|
||||
SwsOpChain *chain)
|
||||
|
||||
@@ -104,10 +104,7 @@ int ff_sws_op_chain_append(SwsOpChain *chain, SwsFuncPtr func,
|
||||
|
||||
typedef struct SwsImplParams {
|
||||
const SwsUOpTable *table;
|
||||
union {
|
||||
const SwsUOp *uop;
|
||||
const SwsOp *op;
|
||||
};
|
||||
const SwsUOp *uop;
|
||||
SwsContext *ctx;
|
||||
} SwsImplParams;
|
||||
|
||||
@@ -132,11 +129,6 @@ typedef struct SwsUOpEntry {
|
||||
bool (*check)(const SwsImplParams *params); /* optional, return true if supported */
|
||||
} SwsUOpEntry;
|
||||
|
||||
/* Setup helpers for common/trivial operation types */
|
||||
int ff_sws_setup_scale(const SwsImplParams *params, SwsImplResult *out);
|
||||
int ff_sws_setup_clamp(const SwsImplParams *params, SwsImplResult *out);
|
||||
int ff_sws_setup_clear(const SwsImplParams *params, SwsImplResult *out);
|
||||
|
||||
/* Setup helpers for SwsUOp data */
|
||||
int ff_sws_setup_scalar(const SwsImplParams *params, SwsImplResult *out);
|
||||
int ff_sws_setup_vec4(const SwsImplParams *params, SwsImplResult *out);
|
||||
|
||||
Reference in new issue
Block a user