#include "avcodec.h"
#include "get_bits.h"
#include "dsputil.h"
+#include "libavutil/attributes.h"
#include "libavutil/colorspace.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/avstring.h"
//#define DEBUG
static void yuv_a_to_rgba(const uint8_t *ycbcr, const uint8_t *alpha, uint32_t *rgba, int num_values)
{
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
+ const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
uint8_t r, g, b;
int i, y, cb, cr;
int r_add, g_add, b_add;
return buf_size;
}
-static int dvdsub_init(AVCodecContext *avctx)
+static av_cold int dvdsub_init(AVCodecContext *avctx)
{
DVDSubContext *ctx = avctx->priv_data;
char *data, *cur;
ctx->has_palette = 1;
for (i = 0; i < 16; i++) {
ctx->palette[i] = strtoul(p, &p, 16);
- while (*p == ',' || isspace(*p))
+ while (*p == ',' || av_isspace(*p))
p++;
}
+ } else if (!strncmp("size:", cur, 5)) {
+ int w, h;
+ if (sscanf(cur + 5, "%dx%d", &w, &h) == 2 &&
+ av_image_check_size(w, h, 0, avctx) >= 0)
+ avcodec_set_dimensions(avctx, w, h);
}
cur += strcspn(cur, "\n\r");
cur += strspn(cur, "\n\r");