swscale: Rename is9_OR_10 to match what it does
It is used to select functions that work with 9-15bits.
This commit is contained in:
@@ -1364,7 +1364,7 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
|
|||||||
if (is16BPS(dstFormat)) {
|
if (is16BPS(dstFormat)) {
|
||||||
*yuv2planeX = isBE(dstFormat) ? yuv2planeX_16BE_c : yuv2planeX_16LE_c;
|
*yuv2planeX = isBE(dstFormat) ? yuv2planeX_16BE_c : yuv2planeX_16LE_c;
|
||||||
*yuv2plane1 = isBE(dstFormat) ? yuv2plane1_16BE_c : yuv2plane1_16LE_c;
|
*yuv2plane1 = isBE(dstFormat) ? yuv2plane1_16BE_c : yuv2plane1_16LE_c;
|
||||||
} else if (is9_OR_10BPS(dstFormat)) {
|
} else if (is9_15BPS(dstFormat)) {
|
||||||
if (desc->comp[0].depth == 9) {
|
if (desc->comp[0].depth == 9) {
|
||||||
*yuv2planeX = isBE(dstFormat) ? yuv2planeX_9BE_c : yuv2planeX_9LE_c;
|
*yuv2planeX = isBE(dstFormat) ? yuv2planeX_9BE_c : yuv2planeX_9LE_c;
|
||||||
*yuv2plane1 = isBE(dstFormat) ? yuv2plane1_9BE_c : yuv2plane1_9LE_c;
|
*yuv2plane1 = isBE(dstFormat) ? yuv2plane1_9BE_c : yuv2plane1_9LE_c;
|
||||||
|
|||||||
@@ -298,7 +298,7 @@ av_cold void ff_sws_init_swscale_ppc(SwsContext *c)
|
|||||||
if (c->srcBpc == 8 && c->dstBpc <= 10) {
|
if (c->srcBpc == 8 && c->dstBpc <= 10) {
|
||||||
c->hyScale = c->hcScale = hScale_altivec_real;
|
c->hyScale = c->hcScale = hScale_altivec_real;
|
||||||
}
|
}
|
||||||
if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) &&
|
if (!is16BPS(dstFormat) && !is9_15BPS(dstFormat) &&
|
||||||
dstFormat != AV_PIX_FMT_NV12 && dstFormat != AV_PIX_FMT_NV21 &&
|
dstFormat != AV_PIX_FMT_NV12 && dstFormat != AV_PIX_FMT_NV21 &&
|
||||||
!c->alpPixBuf) {
|
!c->alpPixBuf) {
|
||||||
c->yuv2planeX = yuv2planeX_altivec;
|
c->yuv2planeX = yuv2planeX_altivec;
|
||||||
|
|||||||
@@ -386,7 +386,7 @@ static int swscale(SwsContext *c, const uint8_t *src[],
|
|||||||
yuv2anyX_fn yuv2anyX = c->yuv2anyX;
|
yuv2anyX_fn yuv2anyX = c->yuv2anyX;
|
||||||
const int chrSrcSliceY = srcSliceY >> c->chrSrcVSubSample;
|
const int chrSrcSliceY = srcSliceY >> c->chrSrcVSubSample;
|
||||||
const int chrSrcSliceH = AV_CEIL_RSHIFT(srcSliceH, c->chrSrcVSubSample);
|
const int chrSrcSliceH = AV_CEIL_RSHIFT(srcSliceH, c->chrSrcVSubSample);
|
||||||
int should_dither = is9_OR_10BPS(c->srcFormat) ||
|
int should_dither = is9_15BPS(c->srcFormat) ||
|
||||||
is16BPS(c->srcFormat);
|
is16BPS(c->srcFormat);
|
||||||
int lastDstY;
|
int lastDstY;
|
||||||
|
|
||||||
@@ -696,7 +696,7 @@ static int swscale(SwsContext *c, const uint8_t *src[],
|
|||||||
if (is16BPS(c->dstFormat))
|
if (is16BPS(c->dstFormat))
|
||||||
length *= 2;
|
length *= 2;
|
||||||
|
|
||||||
if (is9_OR_10BPS(dstFormat)) {
|
if (is9_15BPS(dstFormat)) {
|
||||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(dstFormat);
|
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(dstFormat);
|
||||||
fill_plane9or10(dst[3], dstStride[3], length, height, lastDstY,
|
fill_plane9or10(dst[3], dstStride[3], length, height, lastDstY,
|
||||||
255, desc->comp[3].depth, isBE(dstFormat));
|
255, desc->comp[3].depth, isBE(dstFormat));
|
||||||
|
|||||||
@@ -565,7 +565,7 @@ static av_always_inline int is16BPS(enum AVPixelFormat pix_fmt)
|
|||||||
return desc->comp[0].depth == 16;
|
return desc->comp[0].depth == 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
static av_always_inline int is9_OR_10BPS(enum AVPixelFormat pix_fmt)
|
static av_always_inline int is9_15BPS(enum AVPixelFormat pix_fmt)
|
||||||
{
|
{
|
||||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
|
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
|
||||||
av_assert0(desc);
|
av_assert0(desc);
|
||||||
|
|||||||
@@ -813,7 +813,7 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t *src[],
|
|||||||
int val = (plane == 3) ? 255 : 128;
|
int val = (plane == 3) ? 255 : 128;
|
||||||
if (is16BPS(c->dstFormat))
|
if (is16BPS(c->dstFormat))
|
||||||
length *= 2;
|
length *= 2;
|
||||||
if (is9_OR_10BPS(c->dstFormat)) {
|
if (is9_15BPS(c->dstFormat)) {
|
||||||
fill_plane9or10(dst[plane], dstStride[plane],
|
fill_plane9or10(dst[plane], dstStride[plane],
|
||||||
length, height, y, val,
|
length, height, y, val,
|
||||||
desc_dst->comp[plane].depth,
|
desc_dst->comp[plane].depth,
|
||||||
@@ -822,7 +822,7 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t *src[],
|
|||||||
fillPlane(dst[plane], dstStride[plane], length, height, y,
|
fillPlane(dst[plane], dstStride[plane], length, height, y,
|
||||||
val);
|
val);
|
||||||
} else {
|
} else {
|
||||||
if (is9_OR_10BPS(c->srcFormat)) {
|
if (is9_15BPS(c->srcFormat)) {
|
||||||
const int src_depth = desc_src->comp[plane].depth;
|
const int src_depth = desc_src->comp[plane].depth;
|
||||||
const int dst_depth = desc_dst->comp[plane].depth;
|
const int dst_depth = desc_dst->comp[plane].depth;
|
||||||
const uint16_t *srcPtr2 = (const uint16_t *) srcPtr;
|
const uint16_t *srcPtr2 = (const uint16_t *) srcPtr;
|
||||||
@@ -862,7 +862,7 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t *src[],
|
|||||||
COPY9_OR_10TO16(AV_RL16, AV_WL16);
|
COPY9_OR_10TO16(AV_RL16, AV_WL16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (is9_OR_10BPS(c->dstFormat)) {
|
} else if (is9_15BPS(c->dstFormat)) {
|
||||||
uint16_t *dstPtr2 = (uint16_t *) dstPtr;
|
uint16_t *dstPtr2 = (uint16_t *) dstPtr;
|
||||||
#define COPY9_OR_10TO9_OR_10(loop) \
|
#define COPY9_OR_10TO9_OR_10(loop) \
|
||||||
for (i = 0; i < height; i++) { \
|
for (i = 0; i < height; i++) { \
|
||||||
@@ -914,7 +914,7 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t *src[],
|
|||||||
COPY9_OR_10TO8(AV_RL16);
|
COPY9_OR_10TO8(AV_RL16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (is9_OR_10BPS(c->dstFormat)) {
|
} else if (is9_15BPS(c->dstFormat)) {
|
||||||
const int dst_depth = desc_dst->comp[plane].depth;
|
const int dst_depth = desc_dst->comp[plane].depth;
|
||||||
uint16_t *dstPtr2 = (uint16_t *) dstPtr;
|
uint16_t *dstPtr2 = (uint16_t *) dstPtr;
|
||||||
|
|
||||||
|
|||||||
@@ -1564,7 +1564,7 @@ static av_cold void RENAME(sws_init_swscale)(SwsContext *c)
|
|||||||
{
|
{
|
||||||
enum AVPixelFormat dstFormat = c->dstFormat;
|
enum AVPixelFormat dstFormat = c->dstFormat;
|
||||||
|
|
||||||
if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) &&
|
if (!is16BPS(dstFormat) && !is9_15BPS(dstFormat) &&
|
||||||
dstFormat != AV_PIX_FMT_NV12 && dstFormat != AV_PIX_FMT_NV21) {
|
dstFormat != AV_PIX_FMT_NV12 && dstFormat != AV_PIX_FMT_NV21) {
|
||||||
if (!(c->flags & SWS_BITEXACT)) {
|
if (!(c->flags & SWS_BITEXACT)) {
|
||||||
if (c->flags & SWS_ACCURATE_RND) {
|
if (c->flags & SWS_ACCURATE_RND) {
|
||||||
|
|||||||
Reference in New Issue
Block a user