Change #272258
| Category | ffmpeg |
| Changed by | Niklas Haas <git@haasn.dev> |
| Changed at | Tue 23 Jun 2026 13:48:13 |
| Repository | https://git.ffmpeg.org/ffmpeg.git |
| Project | ffmpeg |
| Branch | master |
| Revision | 09c0cd6837b1063d19e1dbda350281e0e4f99458 |
Comments
swscale/tests/sws_ops: split passes when printing ops lists
This affects a large number of conversions across the board, either:
1. Lifting a constant alpha/chroma clear out from the conversion pass:
rgb24 16x16 -> yuva444p 16x16:
+ [ u8 $XXX] SWS_OP_CLEAR : {255 _ _ _}
+ [ u8 XXXX] SWS_OP_WRITE : 1 elem(s) planar >> 0, via {3}
+ ('X' unused, 'z' byteswapped, '=' copied, '$' const, '+' integer, '0' zero)
+ translated micro-ops:
+ u8_clear_x_1
+ u8_write_planar_x
+ Sub-pass #1:
[ u8 +++X] SWS_OP_READ : 3 elem(s) packed >> 0
[ u8 +++X] SWS_OP_CONVERT : u8 -> f32
[f32 ...X] SWS_OP_LINEAR : matrix3+off3 [...]
[f32 ...X] SWS_OP_DITHER : 16x16 matrix + {0 3 2 -1}
[f32 +++X] SWS_OP_CONVERT : f32 -> u8
- [ u8 +++$] SWS_OP_CLEAR : {_ _ _ 255}
- [ u8 XXXX] SWS_OP_WRITE : 4 elem(s) planar >> 0
+ [ u8 XXXX] SWS_OP_WRITE : 3 elem(s) planar >> 0
('X' unused, 'z' byteswapped, '=' copied, '$' const, '+' integer, '0' zero)
gray 16x16 -> yuv444p 16x16:
+ [ u8 $$XX] SWS_OP_CLEAR : {128 128 _ _}
+ [ u8 XXXX] SWS_OP_WRITE : 2 elem(s) planar >> 0, via {2, 1}
+ ('X' unused, 'z' byteswapped, '=' copied, '$' const, '+' integer, '0' zero)
+ translated micro-ops:
+ u8_clear_xy_xx
+ u8_write_planar_xy
+ Sub-pass #1:
[ u8 =XXX] SWS_OP_READ : 1 elem(s) planar >> 0
[ u8 =XXX] SWS_OP_CONVERT : u8 -> f32
[f32 .XXX] SWS_OP_LINEAR : luma [...]
[f32 .XXX] SWS_OP_DITHER : 16x16 matrix + {0 -1 -1 -1}
[f32 +XXX] SWS_OP_CONVERT : f32 -> u8
- [ u8 +$$X] SWS_OP_CLEAR : {_ 128 128 _}
- [ u8 XXXX] SWS_OP_WRITE : 3 elem(s) planar >> 0
+ [ u8 XXXX] SWS_OP_WRITE : 1 elem(s) planar >> 0
('X' unused, 'z' byteswapped, '=' copied, '$' const, '+' integer, '0' zero)
translated micro-ops:
u8_read_planar_x
u8_to_f32_x
f32_linear_x_x000x
f32_dither_x_0_16x16
f32_to_u8_x
- u8_clear_yz_xx
- u8_write_planar_xyz
+ u8_write_planar_x
or
2. Passing through a plane that was previously unmodified by an ops chain:
gbrap 16x16 -> yuva444p 16x16:
- [ u8 ====] SWS_OP_READ : 4 elem(s) planar >> 0, via {2, 0, 1, 3}
- [ u8 ====] SWS_OP_CONVERT : u8 -> f32
- [f32 ...=] SWS_OP_LINEAR : matrix3+off3 [...]
- [f32 ...=] SWS_OP_DITHER : 16x16 matrix + {0 3 2 -1}
- [f32 +++=] SWS_OP_CONVERT : f32 -> u8
- [ u8 XXXX] SWS_OP_WRITE : 4 elem(s) planar >> 0
+ [ u8 =XXX] SWS_OP_READ : 1 elem(s) planar >> 0, via {3}
+ [ u8 XXXX] SWS_OP_WRITE : 1 elem(s) planar >> 0, via {3}
('X' unused, 'z' byteswapped, '=' copied, '$' const, '+' integer, '0' zero)
translated micro-ops:
- u8_read_planar_xyzw
- u8_to_f32_xyzw
+ u8_read_planar_x
+ u8_write_planar_x
+ Sub-pass #1:
+ [ u8 ===X] SWS_OP_READ : 3 elem(s) planar >> 0, via {2, 0, 1}
+ [ u8 ===X] SWS_OP_CONVERT : u8 -> f32
+ [f32 ...X] SWS_OP_LINEAR : matrix3+off3 [...]
+ [f32 ...X] SWS_OP_DITHER : 16x16 matrix + {0 3 2 -1}
+ [f32 +++X] SWS_OP_CONVERT : f32 -> u8
+ [ u8 XXXX] SWS_OP_WRITE : 3 elem(s) planar >> 0
+ ('X' unused, 'z' byteswapped, '=' copied, '$' const, '+' integer, '0' zero)
+ translated micro-ops:
+ u8_read_planar_xyz
+ u8_to_f32_xyz
f32_linear_xyz_xxx0x_xxx0x_xxx0x
f32_dither_xyz_0_3_2_16x16
- f32_to_u8_xyzw
- u8_write_planar_xyzw
+ f32_to_u8_xyz
+ u8_write_planar_xyz
(Op lists are abridged slightly for brevity)
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
Changed files
- libswscale/tests/sws_ops.c
- tests/ref/fate/sws-ops-list