typedef struct {
H264Context h;
HpelDSPContext hdsp;
- Picture *cur_pic;
- Picture *next_pic;
- Picture *last_pic;
+ H264Picture *cur_pic;
+ H264Picture *next_pic;
+ H264Picture *last_pic;
int halfpel_flag;
int thirdpel_flag;
int unknown_flag;
int mx, int my, int dxy,
int thirdpel, int dir, int avg)
{
- H264Context *h = &s->h;
- const Picture *pic = (dir == 0) ? s->last_pic : s->next_pic;
+ H264Context *h = &s->h;
+ const H264Picture *pic = (dir == 0) ? s->last_pic : s->next_pic;
uint8_t *src, *dest;
int i, emu = 0;
int blocksize = 2 - (width >> 3); // 16->0, 8->1, 4->2
src = pic->f.data[0] + mx + my * h->linesize;
if (emu) {
- h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src, h->linesize,
+ h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src,
+ h->linesize, h->linesize,
width + 1, height + 1,
mx, my, s->h_edge_pos, s->v_edge_pos);
src = h->edge_emu_buffer;
src = pic->f.data[i] + mx + my * h->uvlinesize;
if (emu) {
- h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src, h->uvlinesize,
+ h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src,
+ h->uvlinesize, h->uvlinesize,
width + 1, height + 1,
mx, my, (s->h_edge_pos >> 1),
s->v_edge_pos >> 1);
dir = i_mb_type_info[mb_type - 8].pred_mode;
dir = (dir >> 1) ^ 3 * (dir & 1) ^ 1;
- if ((h->intra16x16_pred_mode = ff_h264_check_intra_pred_mode(h, dir, 0)) == -1) {
- av_log(h->avctx, AV_LOG_ERROR, "check_intra_pred_mode = -1\n");
- return -1;
+ if ((h->intra16x16_pred_mode = ff_h264_check_intra_pred_mode(h, dir, 0)) < 0) {
+ av_log(h->avctx, AV_LOG_ERROR, "ff_h264_check_intra_pred_mode < 0\n");
+ return h->intra16x16_pred_mode;
}
cbp = i_mb_type_info[mb_type - 8].cbp;
int offset = get_bits_count(&gb) + 7 >> 3;
uint8_t *buf;
- if ((uint64_t)watermark_width * 4 > UINT_MAX / watermark_height)
+ if (watermark_height > 0 &&
+ (uint64_t)watermark_width * 4 > UINT_MAX / watermark_height)
return -1;
buf = av_malloc(buf_len);
return 0;
}
-static void free_picture(AVCodecContext *avctx, Picture *pic)
+static void free_picture(AVCodecContext *avctx, H264Picture *pic)
{
int i;
for (i = 0; i < 2; i++) {
av_frame_unref(&pic->f);
}
-static int get_buffer(AVCodecContext *avctx, Picture *pic)
+static int get_buffer(AVCodecContext *avctx, H264Picture *pic)
{
SVQ3Context *s = avctx->priv_data;
H264Context *h = &s->h;
h->pict_type = h->slice_type;
if (h->pict_type != AV_PICTURE_TYPE_B)
- FFSWAP(Picture*, s->next_pic, s->last_pic);
+ FFSWAP(H264Picture*, s->next_pic, s->last_pic);
av_frame_unref(&s->cur_pic->f);
(h->pict_type == AV_PICTURE_TYPE_P && mb_type < 8) ? (mb_type - 1) : -1;
}
- ff_draw_horiz_band(avctx, NULL, s->cur_pic, s->last_pic->f.data[0] ? s->last_pic : NULL,
- 16 * h->mb_y, 16, h->picture_structure, 0, 0,
- h->low_delay, h->mb_height * 16, h->mb_width * 16);
+ ff_draw_horiz_band(avctx, &s->cur_pic->f,
+ s->last_pic->f.data[0] ? &s->last_pic->f : NULL,
+ 16 * h->mb_y, 16, h->picture_structure, 0,
+ h->low_delay);
}
if (h->pict_type == AV_PICTURE_TYPE_B || h->low_delay)
*got_frame = 1;
if (h->pict_type != AV_PICTURE_TYPE_B) {
- FFSWAP(Picture*, s->cur_pic, s->next_pic);
+ FFSWAP(H264Picture*, s->cur_pic, s->next_pic);
} else {
av_frame_unref(&s->cur_pic->f);
}
AVCodec ff_svq3_decoder = {
.name = "svq3",
+ .long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 3 / Sorenson Video 3 / SVQ3"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_SVQ3,
.priv_data_size = sizeof(SVQ3Context),
.capabilities = CODEC_CAP_DRAW_HORIZ_BAND |
CODEC_CAP_DR1 |
CODEC_CAP_DELAY,
- .long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 3 / Sorenson Video 3 / SVQ3"),
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P,
AV_PIX_FMT_NONE},
};