#include <stdio.h>
+#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
typedef struct TransContext {
const AVClass *class;
int hsub, vsub;
+ int planes;
int pixsteps[4];
int passthrough; ///< PassthroughType, landscape passthrough mode enabled
s->hsub = desc_in->log2_chroma_w;
s->vsub = desc_in->log2_chroma_h;
+ s->planes = desc_in->nb_components;
+
+ av_assert0(desc_in->nb_components == desc_out->nb_components);
+
av_image_fill_max_pixsteps(s->pixsteps, NULL, desc_out);
AVFrame *in = td->in;
int plane;
- for (plane = 0; out->data[plane]; plane++) {
+ for (plane = 0; plane < s->planes; plane++) {
int hsub = plane == 1 || plane == 2 ? s->hsub : 0;
int vsub = plane == 1 || plane == 2 ? s->vsub : 0;
int pixstep = s->pixsteps[plane];