summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTorsten Jager <t.jager@gmx.de>2014-05-17 18:04:20 +0200
committerTorsten Jager <t.jager@gmx.de>2014-05-17 18:04:20 +0200
commit559bf6f67db1bb918e21483a0832ca6f6b7fb4ad (patch)
tree2998feb508ac366dfd3b7953188fe7c71b90a216 /src
parent1296a0105c400a3a24bf0c0fe9c8c1ad22653e60 (diff)
downloadxine-lib-559bf6f67db1bb918e21483a0832ca6f6b7fb4ad.tar.gz
xine-lib-559bf6f67db1bb918e21483a0832ca6f6b7fb4ad.tar.bz2
Simplify ffmpeg video edge handling.
Re-enable DR1 for suitably sized video when vo does not crop. So, this one is tested with 4k vp9 video on both AMD Athlon x2 and AMD FX x6. Seems these boxes throw ordinary segfaults not bus errors on misaligned data. Anyway, vp9 soft decoding is terribly slow still. BTW. H.265 and probably vp9 allow variable size macroblocks up to 64 squared luma pixels. For some reason, ffmpeg still wants only 16 pixel edges ??
Diffstat (limited to 'src')
-rw-r--r--src/combined/ffmpeg/ff_video_decoder.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c
index 57cda0714..385360e34 100644
--- a/src/combined/ffmpeg/ff_video_decoder.c
+++ b/src/combined/ffmpeg/ff_video_decoder.c
@@ -278,6 +278,7 @@ static int get_buffer (AVCodecContext *context, AVFrame *av_frame)
/* The visible size, may be smaller. */
int width = context->width;
int height = context->height;
+ int top_edge;
int guarded_render = 0;
/* A bit of unmotivated paranoia... */
@@ -410,7 +411,10 @@ static int get_buffer (AVCodecContext *context, AVFrame *av_frame)
buf_width += 2 * this->edge + 31;
buf_width &= ~31;
/* 2 extra lines for the edge wrap below plus XINE requirement */
- buf_height += 2 * this->edge + 2 + 15;
+ top_edge = this->edge;
+ if (top_edge)
+ top_edge += 2;
+ buf_height += top_edge + this->edge + 15;
buf_height &= ~15;
if ((this->full2mpeg || (this->context->pix_fmt != PIX_FMT_YUV420P &&
@@ -505,16 +509,15 @@ static int get_buffer (AVCodecContext *context, AVFrame *av_frame)
av_frame->linesize[2] = img->pitches[2];
if (this->output_format == XINE_IMGFMT_YV12) {
- /* nasty hack: wrap right edge to the left side when needed to get proper
+ /* nasty hack: wrap left edge to the right side to get proper
SSE2 alignment on all planes. */
- int left_edge = (this->edge + 31) & ~31;
- av_frame->data[0] += img->pitches[0] * this->edge + left_edge;
- av_frame->data[1] += (img->pitches[1] * this->edge + left_edge) / 2;
- av_frame->data[2] += (img->pitches[2] * this->edge + left_edge) / 2;
- img->crop_left = left_edge;
- img->crop_top = this->edge;
- img->crop_right = buf_width - width - left_edge;
- img->crop_bottom = buf_height - height - this->edge;
+ av_frame->data[0] += img->pitches[0] * top_edge;
+ av_frame->data[1] += img->pitches[1] * top_edge / 2;
+ av_frame->data[2] += img->pitches[2] * top_edge / 2;
+ img->crop_left = 0;
+ img->crop_top = top_edge;
+ img->crop_right = buf_width - width;
+ img->crop_bottom = buf_height - height - top_edge;
}
/* We should really keep track of the ages of xine frames (see