mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-20 21:00:41 +08:00
swscale/format: don't mark single byte formats as byte swapped
Fixes a bug where all format lists contained redundant byte swapped annotations on big-endian platforms, even for single-byte formats.
This commit is contained in:
@@ -936,7 +936,8 @@ int ff_sws_decode_pixfmt(SwsOpList *ops, enum AVPixelFormat fmt)
|
||||
|
||||
/* Set baseline pixel content flags */
|
||||
const int integer = ff_sws_pixel_type_is_int(raw_type);
|
||||
const int swapped = (desc->flags & AV_PIX_FMT_FLAG_BE) != NATIVE_ENDIAN_FLAG;
|
||||
const int swapped = ff_sws_pixel_type_size(raw_type) > 1 &&
|
||||
(desc->flags & AV_PIX_FMT_FLAG_BE) != NATIVE_ENDIAN_FLAG;
|
||||
for (int i = 0; i < rw_op.elems; i++) {
|
||||
comps->flags[i] = (integer ? SWS_COMP_EXACT : 0) |
|
||||
(swapped ? SWS_COMP_SWAPPED : 0);
|
||||
@@ -1057,7 +1058,8 @@ int ff_sws_encode_pixfmt(SwsOpList *ops, enum AVPixelFormat fmt)
|
||||
}));
|
||||
}
|
||||
|
||||
if ((desc->flags & AV_PIX_FMT_FLAG_BE) != NATIVE_ENDIAN_FLAG) {
|
||||
if (ff_sws_pixel_type_size(raw_type) > 1 &&
|
||||
(desc->flags & AV_PIX_FMT_FLAG_BE) != NATIVE_ENDIAN_FLAG) {
|
||||
RET(ff_sws_op_list_append(ops, &(SwsOp) {
|
||||
.op = SWS_OP_SWAP_BYTES,
|
||||
.type = raw_type,
|
||||
|
||||
Reference in New Issue
Block a user