} else
FF_ENABLE_DEPRECATION_WARNINGS
#endif /* FF_API_XVMC */
- if (s->er.error_count &&
- !s->avctx->hwaccel &&
- s->unrestricted_mv &&
- s->current_picture.reference &&
- !s->intra_only &&
- !(s->flags & CODEC_FLAG_EMU_EDGE)) {
- const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
- int hshift = desc->log2_chroma_w;
- int vshift = desc->log2_chroma_h;
- s->dsp.draw_edges(s->current_picture.f.data[0], s->linesize,
- s->h_edge_pos, s->v_edge_pos,
- EDGE_WIDTH, EDGE_WIDTH,
- EDGE_TOP | EDGE_BOTTOM);
- s->dsp.draw_edges(s->current_picture.f.data[1], s->uvlinesize,
- s->h_edge_pos >> hshift, s->v_edge_pos >> vshift,
- EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift,
- EDGE_TOP | EDGE_BOTTOM);
- s->dsp.draw_edges(s->current_picture.f.data[2], s->uvlinesize,
- s->h_edge_pos >> hshift, s->v_edge_pos >> vshift,
- EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift,
- EDGE_TOP | EDGE_BOTTOM);
- }
emms_c();
*/
void ff_draw_horiz_band(AVCodecContext *avctx, DSPContext *dsp, Picture *cur,
Picture *last, int y, int h, int picture_structure,
- int first_field, int draw_edges, int low_delay,
+ int first_field, int low_delay,
int v_edge_pos, int h_edge_pos)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
- int hshift = desc->log2_chroma_w;
int vshift = desc->log2_chroma_h;
const int field_pic = picture_structure != PICT_FRAME;
if(field_pic){
y <<= 1;
}
- if (!avctx->hwaccel &&
- draw_edges &&
- cur->reference &&
- !(avctx->flags & CODEC_FLAG_EMU_EDGE)) {
- int *linesize = cur->f.linesize;
- int sides = 0, edge_h;
- if (y==0) sides |= EDGE_TOP;
- if (y + h >= v_edge_pos)
- sides |= EDGE_BOTTOM;
-
- edge_h= FFMIN(h, v_edge_pos - y);
-
- dsp->draw_edges(cur->f.data[0] + y * linesize[0],
- linesize[0], h_edge_pos, edge_h,
- EDGE_WIDTH, EDGE_WIDTH, sides);
- dsp->draw_edges(cur->f.data[1] + (y >> vshift) * linesize[1],
- linesize[1], h_edge_pos >> hshift, edge_h >> vshift,
- EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift, sides);
- dsp->draw_edges(cur->f.data[2] + (y >> vshift) * linesize[2],
- linesize[2], h_edge_pos >> hshift, edge_h >> vshift,
- EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift, sides);
- }
-
h = FFMIN(h, avctx->height - y);
if(field_pic && first_field && !(avctx->slice_flags&SLICE_FLAG_ALLOW_FIELD)) return;
void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h)
{
- int draw_edges = s->unrestricted_mv && !s->intra_only;
ff_draw_horiz_band(s->avctx, &s->dsp, &s->current_picture,
&s->last_picture, y, h, s->picture_structure,
- s->first_field, draw_edges, s->low_delay,
+ s->first_field, s->low_delay,
s->v_edge_pos, s->h_edge_pos);
}
void ff_clean_intra_table_entries(MpegEncContext *s);
void ff_draw_horiz_band(AVCodecContext *avctx, DSPContext *dsp, Picture *cur,
Picture *last, int y, int h, int picture_structure,
- int first_field, int draw_edges, int low_delay,
+ int first_field, int low_delay,
int v_edge_pos, int h_edge_pos);
void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h);
void ff_mpeg_flush(AVCodecContext *avctx);
c->width = s->width >> scale;
c->height = s->height >> scale;
c->flags = CODEC_FLAG_QSCALE | CODEC_FLAG_PSNR |
- CODEC_FLAG_INPUT_PRESERVED /*| CODEC_FLAG_EMU_EDGE*/;
+ CODEC_FLAG_INPUT_PRESERVED;
c->flags |= s->avctx->flags & CODEC_FLAG_QPEL;
c->mb_decision = s->avctx->mb_decision;
c->me_cmp = s->avctx->me_cmp;
ptr = ref_picture[0] + src_y * linesize + src_x;
- if (s->flags & CODEC_FLAG_EMU_EDGE) {
- if ((unsigned)src_x >= FFMAX(s->h_edge_pos - 17, 0) ||
- (unsigned)src_y >= FFMAX(s->v_edge_pos - 17, 0)) {
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
- linesize, linesize,
- 17, 17,
- src_x, src_y,
- s->h_edge_pos, s->v_edge_pos);
- ptr = s->edge_emu_buffer;
- }
+ if ((unsigned)src_x >= FFMAX(s->h_edge_pos - 17, 0) ||
+ (unsigned)src_y >= FFMAX(s->v_edge_pos - 17, 0)) {
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
+ linesize, linesize,
+ 17, 17,
+ src_x, src_y,
+ s->h_edge_pos, s->v_edge_pos);
+ ptr = s->edge_emu_buffer;
}
if ((motion_x | motion_y) & 7) {
offset = (src_y * uvlinesize) + src_x;
ptr = ref_picture[1] + offset;
- if (s->flags & CODEC_FLAG_EMU_EDGE) {
- if ((unsigned)src_x >= FFMAX((s->h_edge_pos >> 1) - 9, 0) ||
- (unsigned)src_y >= FFMAX((s->v_edge_pos >> 1) - 9, 0)) {
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
- uvlinesize, uvlinesize,
- 9, 9,
- src_x, src_y,
- s->h_edge_pos >> 1, s->v_edge_pos >> 1);
- ptr = s->edge_emu_buffer;
- emu = 1;
- }
+ if ((unsigned)src_x >= FFMAX((s->h_edge_pos >> 1) - 9, 0) ||
+ (unsigned)src_y >= FFMAX((s->v_edge_pos >> 1) - 9, 0)) {
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
+ uvlinesize, uvlinesize,
+ 9, 9,
+ src_x, src_y,
+ s->h_edge_pos >> 1, s->v_edge_pos >> 1);
+ ptr = s->edge_emu_buffer;
+ emu = 1;
}
s->dsp.gmc1(dest_cb, ptr, uvlinesize, 8,
motion_x & 15, motion_y & 15, 128 - s->no_rounding);
dxy |= (motion_y & 1) << 1;
src += src_y * s->linesize + src_x;
- if (s->unrestricted_mv && (s->flags & CODEC_FLAG_EMU_EDGE)) {
+ if (s->unrestricted_mv) {
if ((unsigned)src_x > FFMAX(s->h_edge_pos - (motion_x & 1) - 8, 0) ||
(unsigned)src_y > FFMAX(s->v_edge_pos - (motion_y & 1) - 8, 0)) {
s->vdsp.emulated_edge_mc(s->edge_emu_buffer, src,
offset = src_y * s->uvlinesize + src_x;
ptr = ref_picture[1] + offset;
- if (s->flags & CODEC_FLAG_EMU_EDGE) {
- if ((unsigned)src_x > FFMAX((s->h_edge_pos >> 1) - (dxy & 1) - 8, 0) ||
- (unsigned)src_y > FFMAX((s->v_edge_pos >> 1) - (dxy >> 1) - 8, 0)) {
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
- s->uvlinesize, s->uvlinesize,
- 9, 9, src_x, src_y,
- s->h_edge_pos >> 1, s->v_edge_pos >> 1);
- ptr = s->edge_emu_buffer;
- emu = 1;
- }
+ if ((unsigned)src_x > FFMAX((s->h_edge_pos >> 1) - (dxy & 1) - 8, 0) ||
+ (unsigned)src_y > FFMAX((s->v_edge_pos >> 1) - (dxy >> 1) - 8, 0)) {
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
+ s->uvlinesize, s->uvlinesize,
+ 9, 9, src_x, src_y,
+ s->h_edge_pos >> 1, s->v_edge_pos >> 1);
+ ptr = s->edge_emu_buffer;
+ emu = 1;
}
pix_op[dxy](dest_cb, ptr, s->uvlinesize, 8);
dxy &= ~12;
ptr = ref_picture[0] + (src_y * s->linesize) + (src_x);
- if (s->flags & CODEC_FLAG_EMU_EDGE) {
- if ((unsigned)src_x > FFMAX(s->h_edge_pos - (motion_x & 3) - 8, 0) ||
- (unsigned)src_y > FFMAX(s->v_edge_pos - (motion_y & 3) - 8, 0)) {
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
- s->linesize, s->linesize,
- 9, 9,
- src_x, src_y,
- s->h_edge_pos,
- s->v_edge_pos);
- ptr = s->edge_emu_buffer;
- }
+ if ((unsigned)src_x > FFMAX(s->h_edge_pos - (motion_x & 3) - 8, 0) ||
+ (unsigned)src_y > FFMAX(s->v_edge_pos - (motion_y & 3) - 8, 0)) {
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
+ s->linesize, s->linesize,
+ 9, 9,
+ src_x, src_y,
+ s->h_edge_pos,
+ s->v_edge_pos);
+ ptr = s->edge_emu_buffer;
}
dest = dest_y + ((i & 1) * 8) + (i >> 1) * 8 * s->linesize;
qpix_op[1][dxy](dest, ptr, s->linesize);
int ret;
v->s.avctx = avctx;
- avctx->flags |= CODEC_FLAG_EMU_EDGE;
- v->s.flags |= CODEC_FLAG_EMU_EDGE;
if ((ret = ff_vc1_init_common(v)) < 0)
return ret;
s->avctx = avctx;
s->out_format = FMT_H263;
s->codec_id = avctx->codec_id;
- avctx->flags |= CODEC_FLAG_EMU_EDGE;
s->orig_width = s->width = avctx->coded_width;
s->orig_height = s->height = avctx->coded_height;
s->height = avctx->height;
r->s.avctx = avctx;
- avctx->flags |= CODEC_FLAG_EMU_EDGE;
- r->s.flags |= CODEC_FLAG_EMU_EDGE;
avctx->pix_fmt = AV_PIX_FMT_YUV420P;
avctx->has_b_frames = 1;
s->low_delay = 0;
}
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,
+ 16 * h->mb_y, 16, h->picture_structure, 0,
h->low_delay, h->mb_height * 16, h->mb_width * 16);
}
avctx->pix_fmt = AV_PIX_FMT_GRAY8;
avctx->hwaccel = ff_find_hwaccel(avctx);
v->s.avctx = avctx;
- avctx->flags |= CODEC_FLAG_EMU_EDGE;
- v->s.flags |= CODEC_FLAG_EMU_EDGE;
if (ff_vc1_init_common(v) < 0)
return -1;
uvlinesize = s->uvlinesize;
ptr = ref_picture[0] + (src_y * linesize) + src_x;
- if(s->flags&CODEC_FLAG_EMU_EDGE){
- if(src_x<1 || src_y<1 || src_x + 17 >= s->h_edge_pos
- || src_y + h+1 >= v_edge_pos){
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
- ptr - 1 - s->linesize,
- s->linesize, s->linesize,
- 19, 19,
- src_x - 1, src_y - 1,
- s->h_edge_pos, s->v_edge_pos);
- ptr= s->edge_emu_buffer + 1 + s->linesize;
- emu=1;
- }
+ if(src_x<1 || src_y<1 || src_x + 17 >= s->h_edge_pos
+ || src_y + h+1 >= v_edge_pos){
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
+ ptr - 1 - s->linesize,
+ s->linesize, s->linesize,
+ 19, 19,
+ src_x - 1, src_y - 1,
+ s->h_edge_pos, s->v_edge_pos);
+ ptr= s->edge_emu_buffer + 1 + s->linesize;
+ emu=1;
}
s->dsp.put_mspel_pixels_tab[dxy](dest_y , ptr , linesize);