summaryrefslogtreecommitdiff
path: root/libswscale/swscale_internal.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-06-24 13:11:34 +0200
committerAnton Khirnov <anton@khirnov.net>2021-09-06 09:16:52 +0200
commit42cd64c1826d74ce523eb07c7f0910e8f0ade084 (patch)
treea08bc88dbab45f1ac1f27b393eef3f321937e37b /libswscale/swscale_internal.h
parent3c659f861856d751fe3aa1358b1cccff3117f948 (diff)
sws: add a new scaling API
Diffstat (limited to 'libswscale/swscale_internal.h')
-rw-r--r--libswscale/swscale_internal.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index 673407636a..55fa6cec07 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -27,6 +27,7 @@
#include "libavutil/avassert.h"
#include "libavutil/avutil.h"
#include "libavutil/common.h"
+#include "libavutil/frame.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/log.h"
#include "libavutil/mem_internal.h"
@@ -80,6 +81,19 @@ typedef enum SwsAlphaBlend {
SWS_ALPHA_BLEND_NB,
} SwsAlphaBlend;
+typedef struct Range {
+ unsigned int start;
+ unsigned int len;
+} Range;
+
+typedef struct RangeList {
+ Range *ranges;
+ unsigned int nb_ranges;
+ int ranges_allocated;
+} RangeList;
+
+int ff_range_add(RangeList *r, unsigned int start, unsigned int len);
+
typedef int (*SwsFunc)(struct SwsContext *context, const uint8_t *src[],
int srcStride[], int srcSliceY, int srcSliceH,
uint8_t *dst[], int dstStride[]);
@@ -313,6 +327,11 @@ typedef struct SwsContext {
int sliceDir; ///< Direction that slices are fed to the scaler (1 = top-to-bottom, -1 = bottom-to-top).
double param[2]; ///< Input parameters for scaling algorithms that need them.
+ AVFrame *frame_src;
+ AVFrame *frame_dst;
+
+ RangeList src_ranges;
+
/* The cascaded_* fields allow spliting a scaler task into multiple
* sequential steps, this is for example used to limit the maximum
* downscaling factor that needs to be supported in one scaler.
@@ -638,6 +657,8 @@ typedef struct SwsContext {
// then passed as input to further conversion
uint8_t *xyz_scratch;
unsigned int xyz_scratch_allocated;
+
+ unsigned int dst_slice_align;
} SwsContext;
//FIXME check init (where 0)