Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2017-11-09 02:50:04 +0300
committerRostislav Pehlivanov <atomnuker@gmail.com>2017-11-09 03:05:48 +0300
commit3228ac730c11eca49d5680d5550128e397061c85 (patch)
treed1d58e831e225462a2d4a0be00ecc31803a9f433 /libavcodec/vc2enc_dwt.h
parent69218b41980883a7e75656f3058171939f5729ef (diff)
vc2enc_dwt: pad the temporary buffer by the slice size
Since non-Haar wavelets need to look into pixels outside the frame, we need to pad the buffer. The old factor of two seemed to be a workaround that fact and only padded to the left and bottom. This correctly pads by the slice size and as such reduces memory usage and potential exploits. Reported by Liu Bingchang. Ideally, there should be no temporary buffer but the encoder is designed to deinterleave the coefficients into the classical wavelet structure with the lower frequency values in the top left corner. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Diffstat (limited to 'libavcodec/vc2enc_dwt.h')
-rw-r--r--libavcodec/vc2enc_dwt.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/vc2enc_dwt.h b/libavcodec/vc2enc_dwt.h
index 7fbbfbe0ed..a6932bcdaf 100644
--- a/libavcodec/vc2enc_dwt.h
+++ b/libavcodec/vc2enc_dwt.h
@@ -41,12 +41,14 @@ enum VC2TransformType {
typedef struct VC2TransformContext {
dwtcoef *buffer;
+ int padding;
void (*vc2_subband_dwt[VC2_TRANSFORMS_NB])(struct VC2TransformContext *t,
dwtcoef *data, ptrdiff_t stride,
int width, int height);
} VC2TransformContext;
-int ff_vc2enc_init_transforms(VC2TransformContext *t, int p_width, int p_height);
+int ff_vc2enc_init_transforms(VC2TransformContext *t, int p_stride, int p_height,
+ int slice_w, int slice_h);
void ff_vc2enc_free_transforms(VC2TransformContext *t);
#endif /* AVCODEC_VC2ENC_DWT_H */