History

swscale: add sws_is_noop()

Exactly what it says on the tin.

Niklas Haas committed 2 years ago

Commit b03c7581 parent 5e50a564 files · +24 −1Browse files

Unified · Split

4 files
  1. doc/APIchanges +3 −0
  2. libswscale/swscale.h +6 −0
  3. libswscale/utils.c +14 −0
  4. libswscale/version.h +1 −1
doc/APIchanges+3−0
@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2024-03-07 · 1 unmodified line
2 2
3API changes, most recent first:3API changes, most recent first:
4 4
52024-10-23 - xxxxxxxxxx - lsws 8.9.100 - swscale.h
6 Add sws_is_noop().
7
52024-10-23 - xxxxxxxxxx - lsws 8.8.100 - swscale.h82024-10-23 - xxxxxxxxxx - lsws 8.8.100 - swscale.h
6 Add frame property testing API:9 Add frame property testing API:
7 - sws_test_format()10 - sws_test_format()
libswscale/swscale.h+6−0
@@ -140,6 +140,12 @@ int sws_test_transfer(enum AVColorTransferCharacteristic trc, int output); · 139 unmodified lines
140 */140 */
141int sws_test_frame(const AVFrame *frame, int output);141int sws_test_frame(const AVFrame *frame, int output);
142 142
143/**
144 * Check if a given conversion is a noop. Returns a positive integer if
145 * no operation needs to be performed, 0 otherwise.
146 */
147int sws_is_noop(const AVFrame *dst, const AVFrame *src);
148
143/* values for the flags, the stuff on the command line is different */149/* values for the flags, the stuff on the command line is different */
144#define SWS_FAST_BILINEAR 1150#define SWS_FAST_BILINEAR 1
145#define SWS_BILINEAR 2151#define SWS_BILINEAR 2
libswscale/utils.c+14−0
@@ -2777,3 +2777,17 @@ int sws_test_frame(const AVFrame *frame, int output) · 2776 unmodified lines
2777 2777
2778 return 1;2778 return 1;
2779}2779}
2780
2781int sws_is_noop(const AVFrame *dst, const AVFrame *src)
2782{
2783 for (int field = 0; field < 2; field++) {
2784 SwsFormat dst_fmt = ff_fmt_from_frame(dst, field);
2785 SwsFormat src_fmt = ff_fmt_from_frame(src, field);
2786 if (!ff_fmt_equal(&dst_fmt, &src_fmt))
2787 return 0;
2788 if (!dst_fmt.interlaced)
2789 break;
2790 }
2791
2792 return 1;
2793}
libswscale/version.h+1−1
@@ -28,7 +28,7 @@ · 27 unmodified lines
28 28
29#include "version_major.h"29#include "version_major.h"
30 30
31#define LIBSWSCALE_VERSION_MINOR 831#define LIBSWSCALE_VERSION_MINOR 9
32#define LIBSWSCALE_VERSION_MICRO 10032#define LIBSWSCALE_VERSION_MICRO 100
33 33
34#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \34#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t