|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "swscale_loongarch.h" |
|
|
|
void ff_hscale_16_to_15_lsx(SwsContext *c, int16_t *_dst, int dstW, |
|
const uint8_t *_src, const int16_t *filter, |
|
const int32_t *filterPos, int filterSize) |
|
{ |
|
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat); |
|
int sh = desc->comp[0].depth - 1; |
|
|
|
if (sh < 15) { |
|
sh = isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8 ? 13 : |
|
(desc->comp[0].depth - 1); |
|
} else if (desc->flags && AV_PIX_FMT_FLAG_FLOAT) { |
|
sh = 15; |
|
} |
|
ff_hscale_16_to_15_sub_lsx(c, _dst, dstW, _src, filter, filterPos, filterSize, sh); |
|
} |
|
|
|
void ff_hscale_16_to_19_lsx(SwsContext *c, int16_t *_dst, int dstW, |
|
const uint8_t *_src, const int16_t *filter, |
|
const int32_t *filterPos, int filterSize) |
|
{ |
|
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat); |
|
int bits = desc->comp[0].depth - 1; |
|
int sh = bits - 4; |
|
|
|
if ((isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8) && desc->comp[0].depth<16) { |
|
|
|
sh = 9; |
|
} else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { |
|
sh = 16 - 1 - 4; |
|
} |
|
ff_hscale_16_to_19_sub_lsx(c, _dst, dstW, _src, filter, filterPos, filterSize, sh); |
|
} |
|
|