|
@@ -1013,31 +1013,19 @@ static av_always_inline void planar_rgbf32_to_y(uint8_t *_dst, const uint8_t *_s
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-#undef rdpx
|
|
|
-
|
|
|
static av_always_inline void grayf32ToY16_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1,
|
|
|
- const uint8_t *unused2, int width, uint32_t *unused)
|
|
|
+ const uint8_t *unused2, int width, int is_be, uint32_t *unused)
|
|
|
{
|
|
|
int i;
|
|
|
const float *src = (const float *)_src;
|
|
|
uint16_t *dst = (uint16_t *)_dst;
|
|
|
|
|
|
for (i = 0; i < width; ++i){
|
|
|
- dst[i] = av_clip_uint16(lrintf(65535.0f * src[i]));
|
|
|
+ dst[i] = av_clip_uint16(lrintf(65535.0f * rdpx(src + i)));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-static av_always_inline void grayf32ToY16_bswap_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1,
|
|
|
- const uint8_t *unused2, int width, uint32_t *unused)
|
|
|
-{
|
|
|
- int i;
|
|
|
- const uint32_t *src = (const uint32_t *)_src;
|
|
|
- uint16_t *dst = (uint16_t *)_dst;
|
|
|
-
|
|
|
- for (i = 0; i < width; ++i){
|
|
|
- dst[i] = av_clip_uint16(lrintf(65535.0f * av_int2float(av_bswap32(src[i]))));
|
|
|
- }
|
|
|
-}
|
|
|
+#undef rdpx
|
|
|
|
|
|
#define rgb9plus_planar_funcs_endian(nbits, endian_name, endian) \
|
|
|
static void planar_rgb##nbits##endian_name##_to_y(uint8_t *dst, const uint8_t *src[4], \
|
|
@@ -1092,6 +1080,12 @@ static void planar_rgbf32##endian_name##_to_a(uint8_t *dst, const uint8_t *src[4
|
|
|
int w, int32_t *rgb2yuv) \
|
|
|
{ \
|
|
|
planar_rgbf32_to_a(dst, src, w, endian, rgb2yuv); \
|
|
|
+} \
|
|
|
+static void grayf32##endian_name##ToY16_c(uint8_t *dst, const uint8_t *src, \
|
|
|
+ const uint8_t *unused1, const uint8_t *unused2, \
|
|
|
+ int width, uint32_t *unused) \
|
|
|
+{ \
|
|
|
+ grayf32ToY16_c(dst, src, unused1, unused2, width, endian, unused); \
|
|
|
}
|
|
|
|
|
|
rgbf32_planar_funcs_endian(le, 0)
|
|
@@ -1699,18 +1693,10 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
|
|
|
c->lumToYV12 = p010BEToY_c;
|
|
|
break;
|
|
|
case AV_PIX_FMT_GRAYF32LE:
|
|
|
-#if HAVE_BIGENDIAN
|
|
|
- c->lumToYV12 = grayf32ToY16_bswap_c;
|
|
|
-#else
|
|
|
- c->lumToYV12 = grayf32ToY16_c;
|
|
|
-#endif
|
|
|
+ c->lumToYV12 = grayf32leToY16_c;
|
|
|
break;
|
|
|
case AV_PIX_FMT_GRAYF32BE:
|
|
|
-#if HAVE_BIGENDIAN
|
|
|
- c->lumToYV12 = grayf32ToY16_c;
|
|
|
-#else
|
|
|
- c->lumToYV12 = grayf32ToY16_bswap_c;
|
|
|
-#endif
|
|
|
+ c->lumToYV12 = grayf32beToY16_c;
|
|
|
break;
|
|
|
case AV_PIX_FMT_Y210LE:
|
|
|
c->lumToYV12 = y210le_Y_c;
|