1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

CODEC_CAP_DRAW_HORIZ_BAND

Originally committed as revision 1886 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2003-05-16 10:14:25 +00:00
parent 669ac79cf5
commit 4c701ac80d

View File

@ -271,15 +271,15 @@ static inline void svq3_mc_dir_part (MpegEncContext *s, int x, int y,
mx += x; mx += x;
my += y; my += y;
if (mx < 0 || mx >= (s->width - width - 1) || if (mx < 0 || mx >= (s->h_edge_pos - width - 1) ||
my < 0 || my >= (s->height - height - 1)) { my < 0 || my >= (s->v_edge_pos - height - 1)) {
if ((s->flags & CODEC_FLAG_EMU_EDGE)) { if ((s->flags & CODEC_FLAG_EMU_EDGE)) {
emu = 1; emu = 1;
} }
mx = clip (mx, -16, (s->width - width + 15)); mx = clip (mx, -16, (s->h_edge_pos - width + 15));
my = clip (my, -16, (s->height - height + 15)); my = clip (my, -16, (s->v_edge_pos - height + 15));
} }
/* form component predictions */ /* form component predictions */
@ -288,7 +288,7 @@ static inline void svq3_mc_dir_part (MpegEncContext *s, int x, int y,
if (emu) { if (emu) {
ff_emulated_edge_mc (s, src, s->linesize, (width + 1), (height + 1), ff_emulated_edge_mc (s, src, s->linesize, (width + 1), (height + 1),
mx, my, s->width, s->height); mx, my, s->h_edge_pos, s->v_edge_pos);
src = s->edge_emu_buffer; src = s->edge_emu_buffer;
} }
if(thirdpel) if(thirdpel)
@ -309,7 +309,7 @@ static inline void svq3_mc_dir_part (MpegEncContext *s, int x, int y,
if (emu) { if (emu) {
ff_emulated_edge_mc (s, src, s->uvlinesize, (width + 1), (height + 1), ff_emulated_edge_mc (s, src, s->uvlinesize, (width + 1), (height + 1),
mx, my, (s->width >> 1), (s->height >> 1)); mx, my, (s->h_edge_pos >> 1), (s->v_edge_pos >> 1));
src = s->edge_emu_buffer; src = s->edge_emu_buffer;
} }
if(thirdpel) if(thirdpel)
@ -397,8 +397,8 @@ static int svq3_decode_mb (H264Context *h, unsigned int mb_type) {
pred_motion (h, k, (part_width >> 2), 0, 1, &mx, &my); pred_motion (h, k, (part_width >> 2), 0, 1, &mx, &my);
/* clip motion vector prediction to frame border */ /* clip motion vector prediction to frame border */
mx = clip (mx, -6*x, 6*(s->width - part_width - x)); mx = clip (mx, -6*x, 6*(s->h_edge_pos - part_width - x));
my = clip (my, -6*y, 6*(s->height - part_height - y)); my = clip (my, -6*y, 6*(s->v_edge_pos - part_height - y));
/* get motion vector differential */ /* get motion vector differential */
dy = svq3_get_se_golomb (&s->gb); dy = svq3_get_se_golomb (&s->gb);
@ -576,11 +576,10 @@ static int svq3_decode_frame (AVCodecContext *avctx,
int i; int i;
s->flags = avctx->flags; s->flags = avctx->flags;
if (!s->context_initialized) { if (!s->context_initialized) {
s->width = (avctx->width + 15) & ~15; s->width = avctx->width;
s->height = (avctx->height + 15) & ~15; s->height = avctx->height;
h->b_stride = (s->width >> 2);
h->pred4x4[DIAG_DOWN_LEFT_PRED] = pred4x4_down_left_svq3_c; h->pred4x4[DIAG_DOWN_LEFT_PRED] = pred4x4_down_left_svq3_c;
h->pred16x16[PLANE_PRED8x8] = pred16x16_plane_svq3_c; h->pred16x16[PLANE_PRED8x8] = pred16x16_plane_svq3_c;
h->halfpel_flag = 1; h->halfpel_flag = 1;
@ -590,8 +589,13 @@ static int svq3_decode_frame (AVCodecContext *avctx,
if (MPV_common_init (s) < 0) if (MPV_common_init (s) < 0)
return -1; return -1;
h->b_stride = 4*s->mb_width;
alloc_tables (h); alloc_tables (h);
} }
s->low_delay= 1;
if (avctx->extradata && avctx->extradata_size >= 0x63 if (avctx->extradata && avctx->extradata_size >= 0x63
&& !memcmp (avctx->extradata, "SVQ3", 4)) { && !memcmp (avctx->extradata, "SVQ3", 4)) {
@ -685,6 +689,8 @@ static int svq3_decode_frame (AVCodecContext *avctx,
hl_decode_mb (h); hl_decode_mb (h);
} }
} }
ff_draw_horiz_band(s, 16*s->mb_y, 16);
} }
*(AVFrame *) data = *(AVFrame *) &s->current_picture; *(AVFrame *) data = *(AVFrame *) &s->current_picture;
@ -705,5 +711,5 @@ AVCodec svq3_decoder = {
NULL, NULL,
decode_end, decode_end,
svq3_decode_frame, svq3_decode_frame,
CODEC_CAP_DR1, CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
}; };