From a71d524ecad48837e0124a03124bc05f59a48be7 Mon Sep 17 00:00:00 2001 From: marha Date: Thu, 30 Apr 2015 23:24:30 +0200 Subject: fontconfig pixman libX11 mesa git update 30 Apr 2015 libX11 commit d3415d1f052530760b4617db45affcb984cfe35c pixman commit e0c0153d8e5d42c08c2b9bd2cf2123bff2c48d75 fontconfig commit 4a6f5efd5f6a468e1872d58e589bcf30ba88e2fd mesa commit 1ac7db07b363207e8ded9259f84bbcaa084b8667 --- mesalib/src/gallium/auxiliary/util/u_tile.c | 4 ++-- mesalib/src/gallium/auxiliary/util/u_video.h | 36 ++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) (limited to 'mesalib/src/gallium/auxiliary/util') diff --git a/mesalib/src/gallium/auxiliary/util/u_tile.c b/mesalib/src/gallium/auxiliary/util/u_tile.c index 8e199200f..b91bb413a 100644 --- a/mesalib/src/gallium/auxiliary/util/u_tile.c +++ b/mesalib/src/gallium/auxiliary/util/u_tile.c @@ -341,13 +341,13 @@ x32_s8_get_tile_rgba(const unsigned *src, unsigned i, j; for (i = 0; i < h; i++) { - float *pRow = p; + uint32_t *pRow = (uint32_t *)p; for (j = 0; j < w; j++, pRow += 4) { src++; pRow[0] = pRow[1] = pRow[2] = - pRow[3] = (float)(*src++ & 0xff); + pRow[3] = (*src++ & 0xff); } p += dst_stride; } diff --git a/mesalib/src/gallium/auxiliary/util/u_video.h b/mesalib/src/gallium/auxiliary/util/u_video.h index 45b2d6e76..b4743d13f 100644 --- a/mesalib/src/gallium/auxiliary/util/u_video.h +++ b/mesalib/src/gallium/auxiliary/util/u_video.h @@ -38,6 +38,7 @@ extern "C" { /* u_reduce_video_profile() needs these */ #include "pipe/p_compiler.h" #include "util/u_debug.h" +#include "util/u_math.h" static INLINE enum pipe_video_format u_reduce_video_profile(enum pipe_video_profile profile) @@ -146,6 +147,41 @@ u_copy_swap422_packed(void *const *destination_data, } } +static INLINE uint32_t +u_get_h264_level(uint32_t width, uint32_t height, uint32_t *max_reference) +{ + uint32_t max_dpb_mbs; + + width = align(width, 16); + height = align(height, 16); + + /* Max references will be used for caculation of number of DPB buffers + in the UVD driver, limitation of max references is 16. Some client + like mpv application for VA-API, it requires references more than that, + so we have to set max of references to 16 here. */ + *max_reference = MIN2(*max_reference, 16); + max_dpb_mbs = (width / 16) * (height / 16) * *max_reference; + + /* The calculation is based on "Decoded picture buffering" section + from http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC */ + if (max_dpb_mbs <= 8100) + return 30; + else if (max_dpb_mbs <= 18000) + return 31; + else if (max_dpb_mbs <= 20480) + return 32; + else if (max_dpb_mbs <= 32768) + return 41; + else if (max_dpb_mbs <= 34816) + return 42; + else if (max_dpb_mbs <= 110400) + return 50; + else if (max_dpb_mbs <= 184320) + return 51; + else + return 52; +} + #ifdef __cplusplus } #endif -- cgit v1.2.3