diff options
author | Julian Scheel <julian@jusst.de> | 2008-12-29 12:00:38 +0000 |
---|---|---|
committer | Julian Scheel <julian@jusst.de> | 2008-12-29 12:00:38 +0000 |
commit | 9628a10ef165e817353e2723c3d320348a4584e9 (patch) | |
tree | d356ed4d749ae98801d67e28bda5b4d141014ab4 /src | |
parent | 25575a3f4cc3ec3147f0b47ff99f53501cb0e565 (diff) | |
download | xine-lib-9628a10ef165e817353e2723c3d320348a4584e9.tar.gz xine-lib-9628a10ef165e817353e2723c3d320348a4584e9.tar.bz2 |
Properly calculate the needed ref-frame count.
Diffstat (limited to 'src')
-rw-r--r-- | src/libvdpau/vdpau_h264.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libvdpau/vdpau_h264.c b/src/libvdpau/vdpau_h264.c index d69aa0b5c..cbbe9b009 100644 --- a/src/libvdpau/vdpau_h264.c +++ b/src/libvdpau/vdpau_h264.c @@ -312,6 +312,21 @@ static void vdpau_h264_decode_data (video_decoder_t *this_gen, break; } + // Level 4.1 limits: + int ref_frames = 0; + if(this->nal_parser->current_nal->sps->num_ref_frames) { + ref_frames = this->nal_parser->current_nal->sps->num_ref_frames; + } else { + uint32_t round_width = (this->width + 15) & ~15; + uint32_t round_height = (this->height + 15) & ~15; + uint32_t surf_size = (round_width * round_height * 3) / 2; + ref_frames = (12 * 1024 * 1024) / surf_size; + } + + if (ref_frames > 16) { + ref_frames = 16; + } + /* get the vdpau context from vo */ //(this->stream->video_out->open) (this->stream->video_out, this->stream); img = this->stream->video_out->get_frame (this->stream->video_out, |