#include "pipe/p_compiler.h"
#include "util/u_debug.h"
-static INLINE enum pipe_video_codec
+static INLINE enum pipe_video_format
u_reduce_video_profile(enum pipe_video_profile profile)
{
switch (profile)
case PIPE_VIDEO_PROFILE_MPEG1:
case PIPE_VIDEO_PROFILE_MPEG2_SIMPLE:
case PIPE_VIDEO_PROFILE_MPEG2_MAIN:
- return PIPE_VIDEO_CODEC_MPEG12;
+ return PIPE_VIDEO_FORMAT_MPEG12;
case PIPE_VIDEO_PROFILE_MPEG4_SIMPLE:
case PIPE_VIDEO_PROFILE_MPEG4_ADVANCED_SIMPLE:
- return PIPE_VIDEO_CODEC_MPEG4;
+ return PIPE_VIDEO_FORMAT_MPEG4;
case PIPE_VIDEO_PROFILE_VC1_SIMPLE:
case PIPE_VIDEO_PROFILE_VC1_MAIN:
case PIPE_VIDEO_PROFILE_VC1_ADVANCED:
- return PIPE_VIDEO_CODEC_VC1;
+ return PIPE_VIDEO_FORMAT_VC1;
case PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE:
case PIPE_VIDEO_PROFILE_MPEG4_AVC_MAIN:
case PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH:
- return PIPE_VIDEO_CODEC_MPEG4_AVC;
+ return PIPE_VIDEO_FORMAT_MPEG4_AVC;
default:
- return PIPE_VIDEO_CODEC_UNKNOWN;
+ return PIPE_VIDEO_FORMAT_UNKNOWN;
}
}
{
assert(screen);
switch (u_reduce_video_profile(profile)) {
- case PIPE_VIDEO_CODEC_MPEG12:
+ case PIPE_VIDEO_FORMAT_MPEG12:
return true;
default:
return false;
temp.height = pot_buffers ? util_next_power_of_two(height) : align(height, VL_MACROBLOCK_HEIGHT);
switch (u_reduce_video_profile(temp.profile)) {
- case PIPE_VIDEO_CODEC_MPEG12:
+ case PIPE_VIDEO_FORMAT_MPEG12:
return vl_create_mpeg12_decoder(pipe, &temp);
default:
signed x = -1;
memset(&mb, 0, sizeof(mb));
- mb.base.codec = PIPE_VIDEO_CODEC_MPEG12;
+ mb.base.codec = PIPE_VIDEO_FORMAT_MPEG12;
mb.y = vl_vlc_get_uimsbf(&bs->vlc, 8) - 1;
mb.blocks = dct_blocks;
unsigned i, j, mv_weights[2];
assert(dec && target && picture);
- assert(macroblocks && macroblocks->codec == PIPE_VIDEO_CODEC_MPEG12);
+ assert(macroblocks && macroblocks->codec == PIPE_VIDEO_FORMAT_MPEG12);
buf = vl_mpeg12_get_decode_buffer(dec, target);
assert(buf);
const struct format_config *format_config;
struct vl_mpeg12_decoder *dec;
- assert(u_reduce_video_profile(templat->profile) == PIPE_VIDEO_CODEC_MPEG12);
+ assert(u_reduce_video_profile(templat->profile) == PIPE_VIDEO_FORMAT_MPEG12);
dec = CALLOC_STRUCT(vl_mpeg12_decoder);
if (getenv("XVMC_VL"))
goto vl;
- if (u_reduce_video_profile(templ->profile) != PIPE_VIDEO_CODEC_MPEG12)
+ if (u_reduce_video_profile(templ->profile) != PIPE_VIDEO_FORMAT_MPEG12)
goto vl;
if (screen->device->chipset >= 0x98 && screen->device->chipset != 0xa0)
goto vl;
static void vp3_getpath(enum pipe_video_profile profile, char *path)
{
switch (u_reduce_video_profile(profile)) {
- case PIPE_VIDEO_CODEC_MPEG12: {
+ case PIPE_VIDEO_FORMAT_MPEG12: {
sprintf(path, "/lib/firmware/nouveau/vuc-vp3-mpeg12-0");
break;
}
- case PIPE_VIDEO_CODEC_VC1: {
+ case PIPE_VIDEO_FORMAT_VC1: {
sprintf(path, "/lib/firmware/nouveau/vuc-vp3-vc1-0");
break;
}
- case PIPE_VIDEO_CODEC_MPEG4_AVC: {
+ case PIPE_VIDEO_FORMAT_MPEG4_AVC: {
sprintf(path, "/lib/firmware/nouveau/vuc-vp3-h264-0");
break;
}
static void vp4_getpath(enum pipe_video_profile profile, char *path)
{
switch (u_reduce_video_profile(profile)) {
- case PIPE_VIDEO_CODEC_MPEG12: {
+ case PIPE_VIDEO_FORMAT_MPEG12: {
sprintf(path, "/lib/firmware/nouveau/vuc-mpeg12-0");
break;
}
- case PIPE_VIDEO_CODEC_MPEG4: {
+ case PIPE_VIDEO_FORMAT_MPEG4: {
sprintf(path, "/lib/firmware/nouveau/vuc-mpeg4-0");
break;
}
- case PIPE_VIDEO_CODEC_VC1: {
+ case PIPE_VIDEO_FORMAT_VC1: {
sprintf(path, "/lib/firmware/nouveau/vuc-vc1-0");
break;
}
- case PIPE_VIDEO_CODEC_MPEG4_AVC: {
+ case PIPE_VIDEO_FORMAT_MPEG4_AVC: {
sprintf(path, "/lib/firmware/nouveau/vuc-h264-0");
break;
}
r = (intptr_t)end - (intptr_t)dec->fw_bo->map + 4;
switch (u_reduce_video_profile(profile)) {
- case PIPE_VIDEO_CODEC_MPEG12: {
+ case PIPE_VIDEO_FORMAT_MPEG12: {
assert((r & 0xff) == 0xe0);
dec->fw_sizes = (0x2e0<<16) | (r - 0x2e0);
break;
}
- case PIPE_VIDEO_CODEC_MPEG4: {
+ case PIPE_VIDEO_FORMAT_MPEG4: {
assert((r & 0xff) == 0xe0);
dec->fw_sizes = (0x2e0<<16) | (r - 0x2e0);
break;
}
- case PIPE_VIDEO_CODEC_VC1: {
+ case PIPE_VIDEO_FORMAT_VC1: {
assert((r & 0xff) == 0xac);
dec->fw_sizes = (0x3ac<<16) | (r - 0x3ac);
break;
}
- case PIPE_VIDEO_CODEC_MPEG4_AVC: {
+ case PIPE_VIDEO_FORMAT_MPEG4_AVC: {
assert((r & 0xff) == 0x70);
dec->fw_sizes = (0x370<<16) | (r - 0x370);
break;
int chipset = nouveau_screen(pscreen)->device->chipset;
int vp3 = chipset < 0xa3 || chipset == 0xaa || chipset == 0xac;
int vp5 = chipset >= 0xd0;
- enum pipe_video_codec codec = u_reduce_video_profile(profile);
+ enum pipe_video_format codec = u_reduce_video_profile(profile);
switch (param) {
case PIPE_VIDEO_CAP_SUPPORTED:
/* For now, h264 and mpeg4 don't work on pre-nvc0. */
if (chipset < 0xc0)
- return codec == PIPE_VIDEO_CODEC_MPEG12 ||
- codec == PIPE_VIDEO_CODEC_VC1;
+ return codec == PIPE_VIDEO_FORMAT_MPEG12 ||
+ codec == PIPE_VIDEO_FORMAT_VC1;
/* In the general case, this should work, once the pre-nvc0 problems are
* resolved. */
return profile >= PIPE_VIDEO_PROFILE_MPEG1 && (
- !vp3 || codec != PIPE_VIDEO_CODEC_MPEG4);
+ !vp3 || codec != PIPE_VIDEO_FORMAT_MPEG4);
case PIPE_VIDEO_CAP_NPOT_TEXTURES:
return 1;
case PIPE_VIDEO_CAP_MAX_WIDTH:
uint32_t *ring_size)
{
*slice_size = (SLICE_SIZE * slice_count)>>8;
- if (u_reduce_video_profile(dec->base.profile) == PIPE_VIDEO_CODEC_MPEG12)
+ if (u_reduce_video_profile(dec->base.profile) == PIPE_VIDEO_FORMAT_MPEG12)
*bucket_size = 0;
else
*bucket_size = mb(dec->base.width) * 3;
unsigned comm_seq, unsigned num_buffers,
const void *const *data, const unsigned *num_bytes)
{
- enum pipe_video_codec codec = u_reduce_video_profile(dec->base.profile);
+ enum pipe_video_format codec = u_reduce_video_profile(dec->base.profile);
struct nouveau_bo *bsp_bo = dec->bsp_bo[comm_seq % NOUVEAU_VP3_VIDEO_QDEPTH];
char *bsp;
uint32_t endmarker, caps;
*/
switch (codec){
- case PIPE_VIDEO_CODEC_MPEG12:
+ case PIPE_VIDEO_FORMAT_MPEG12:
endmarker = 0xb7010000;
caps = nouveau_vp3_fill_picparm_mpeg12_bsp(dec, desc.mpeg12, bsp);
break;
- case PIPE_VIDEO_CODEC_MPEG4:
+ case PIPE_VIDEO_FORMAT_MPEG4:
endmarker = 0xb1010000;
caps = nouveau_vp3_fill_picparm_mpeg4_bsp(dec, desc.mpeg4, bsp);
break;
- case PIPE_VIDEO_CODEC_VC1: {
+ case PIPE_VIDEO_FORMAT_VC1: {
endmarker = 0x0a010000;
caps = nouveau_vp3_fill_picparm_vc1_bsp(dec, desc.vc1, bsp);
break;
}
- case PIPE_VIDEO_CODEC_MPEG4_AVC: {
+ case PIPE_VIDEO_FORMAT_MPEG4_AVC: {
endmarker = 0x0b010000;
caps = nouveau_vp3_fill_picparm_h264_bsp(dec, desc.h264, bsp);
break;
static void
nouveau_vp3_handle_references(struct nouveau_vp3_decoder *dec, struct nouveau_vp3_video_buffer *refs[16], unsigned seq, struct nouveau_vp3_video_buffer *target)
{
- unsigned h264 = u_reduce_video_profile(dec->base.profile) == PIPE_VIDEO_CODEC_MPEG4_AVC;
+ unsigned h264 = u_reduce_video_profile(dec->base.profile) == PIPE_VIDEO_FORMAT_MPEG4_AVC;
unsigned i, idx, empty_spot = dec->base.max_references + 1;
for (i = 0; i < dec->base.max_references; ++i) {
if (!refs[i])
struct nouveau_vp3_video_buffer *refs[16])
{
struct nouveau_bo *bsp_bo = dec->bsp_bo[comm_seq % NOUVEAU_VP3_VIDEO_QDEPTH];
- enum pipe_video_codec codec = u_reduce_video_profile(dec->base.profile);
+ enum pipe_video_format codec = u_reduce_video_profile(dec->base.profile);
char *vp = bsp_bo->map + VP_OFFSET;
switch (codec){
- case PIPE_VIDEO_CODEC_MPEG12:
+ case PIPE_VIDEO_FORMAT_MPEG12:
*caps = nouveau_vp3_fill_picparm_mpeg12_vp(dec, desc.mpeg12, refs, is_ref, vp);
nouveau_vp3_handle_references(dec, refs, dec->fence_seq, target);
return;
- case PIPE_VIDEO_CODEC_MPEG4:
+ case PIPE_VIDEO_FORMAT_MPEG4:
*caps = nouveau_vp3_fill_picparm_mpeg4_vp(dec, desc.mpeg4, refs, is_ref, vp);
nouveau_vp3_handle_references(dec, refs, dec->fence_seq, target);
return;
- case PIPE_VIDEO_CODEC_VC1: {
+ case PIPE_VIDEO_FORMAT_VC1: {
*caps = nouveau_vp3_fill_picparm_vc1_vp(dec, desc.vc1, refs, is_ref, vp);
nouveau_vp3_handle_references(dec, refs, dec->fence_seq, target);
return;
}
- case PIPE_VIDEO_CODEC_MPEG4_AVC: {
+ case PIPE_VIDEO_FORMAT_MPEG4_AVC: {
*caps = nouveau_vp3_fill_picparm_h264_vp(dec, desc.h264, refs, is_ref, vp);
nouveau_vp3_handle_references(dec, refs, dec->fence_seq, target);
nouveau_vp3_fill_picparm_h264_vp_refs(dec, desc.h264, refs, target, vp);
union pipe_color_union color;
struct nv04_fifo nv04_data = { .vram = 0xbeef0201, .gart = 0xbeef0202 };
int ret, i;
- int is_h264 = u_reduce_video_profile(templ->profile) == PIPE_VIDEO_CODEC_MPEG4_AVC;
- int is_mpeg12 = u_reduce_video_profile(templ->profile) == PIPE_VIDEO_CODEC_MPEG12;
+ int is_h264 = u_reduce_video_profile(templ->profile) == PIPE_VIDEO_FORMAT_MPEG4_AVC;
+ int is_mpeg12 = u_reduce_video_profile(templ->profile) == PIPE_VIDEO_FORMAT_MPEG12;
if (getenv("XVMC_VL"))
return vl_create_decoder(context, templ);
{
switch (param) {
case PIPE_VIDEO_CAP_SUPPORTED:
- return u_reduce_video_profile(profile) == PIPE_VIDEO_CODEC_MPEG4_AVC ||
- u_reduce_video_profile(profile) == PIPE_VIDEO_CODEC_MPEG12;
+ return u_reduce_video_profile(profile) == PIPE_VIDEO_FORMAT_MPEG4_AVC ||
+ u_reduce_video_profile(profile) == PIPE_VIDEO_FORMAT_MPEG12;
case PIPE_VIDEO_CAP_NPOT_TEXTURES:
return 1;
case PIPE_VIDEO_CAP_MAX_WIDTH:
goto fail;
switch (u_reduce_video_profile(templ->profile)) {
- case PIPE_VIDEO_CODEC_MPEG12: {
+ case PIPE_VIDEO_FORMAT_MPEG12: {
codec = 1;
assert(templ->max_references <= 2);
break;
}
- case PIPE_VIDEO_CODEC_MPEG4: {
+ case PIPE_VIDEO_FORMAT_MPEG4: {
codec = 4;
tmp_size = mb(templ->height)*16 * mb(templ->width)*16;
assert(templ->max_references <= 2);
break;
}
- case PIPE_VIDEO_CODEC_VC1: {
+ case PIPE_VIDEO_FORMAT_VC1: {
ppp_codec = codec = 2;
tmp_size = mb(templ->height)*16 * mb(templ->width)*16;
assert(templ->max_references <= 2);
break;
}
- case PIPE_VIDEO_CODEC_MPEG4_AVC: {
+ case PIPE_VIDEO_FORMAT_MPEG4_AVC: {
codec = 3;
dec->tmp_stride = 16 * mb_half(templ->width) * nouveau_vp3_video_align(templ->height) * 3 / 2;
tmp_size = dec->tmp_stride * (templ->max_references + 1);
struct nouveau_vp3_video_buffer *refs[16])
{
struct nouveau_pushbuf *push = dec->pushbuf[0];
- enum pipe_video_codec codec = u_reduce_video_profile(dec->base.profile);
+ enum pipe_video_format codec = u_reduce_video_profile(dec->base.profile);
uint32_t bsp_addr, comm_addr, inter_addr;
uint32_t slice_size, bucket_size, ring_size;
uint32_t caps;
nouveau_vp3_vp_caps(dec, desc, target, comm_seq, vp_caps, is_ref, refs);
- nouveau_pushbuf_space(push, 6 + (codec == PIPE_VIDEO_CODEC_MPEG4_AVC ? 9 : 8) + fence_extra + 2, num_refs, 0);
+ nouveau_pushbuf_space(push, 6 + (codec == PIPE_VIDEO_FORMAT_MPEG4_AVC ? 9 : 8) + fence_extra + 2, num_refs, 0);
nouveau_pushbuf_refn(push, bo_refs, num_refs);
bsp_addr = bsp_bo->offset >> 8;
PUSH_DATA (push, comm_addr); // 70c comm
PUSH_DATA (push, comm_seq); // 710 seq
- if (codec != PIPE_VIDEO_CODEC_MPEG4_AVC) {
+ if (codec != PIPE_VIDEO_FORMAT_MPEG4_AVC) {
u32 bitplane_addr;
- int mpeg12 = (codec == PIPE_VIDEO_CODEC_MPEG12);
+ int mpeg12 = (codec == PIPE_VIDEO_FORMAT_MPEG12);
bitplane_addr = dec->bitplane_bo->offset >> 8;
void
nv98_decoder_ppp(struct nouveau_vp3_decoder *dec, union pipe_desc desc, struct nouveau_vp3_video_buffer *target, unsigned comm_seq) {
- enum pipe_video_codec codec = u_reduce_video_profile(dec->base.profile);
+ enum pipe_video_format codec = u_reduce_video_profile(dec->base.profile);
struct nouveau_pushbuf *push = dec->pushbuf[2];
unsigned ppp_caps = 0x10;
unsigned fence_extra = 0;
fence_extra = 4;
#endif
- nouveau_pushbuf_space(push, 11 + (codec == PIPE_VIDEO_CODEC_VC1 ? 2 : 0) + 3 + fence_extra + 2, 4, 0);
+ nouveau_pushbuf_space(push, 11 + (codec == PIPE_VIDEO_FORMAT_VC1 ? 2 : 0) + 3 + fence_extra + 2, 4, 0);
switch (codec) {
- case PIPE_VIDEO_CODEC_MPEG12: {
+ case PIPE_VIDEO_FORMAT_MPEG12: {
unsigned mpeg2 = dec->base.profile != PIPE_VIDEO_PROFILE_MPEG1;
nv98_decoder_setup_ppp(dec, target, 0x1410 | mpeg2);
break;
}
- case PIPE_VIDEO_CODEC_MPEG4: nv98_decoder_setup_ppp(dec, target, 0x1414); break;
- case PIPE_VIDEO_CODEC_VC1: ppp_caps = nv98_decoder_vc1_ppp(dec, desc.vc1, target); break;
- case PIPE_VIDEO_CODEC_MPEG4_AVC: nv98_decoder_setup_ppp(dec, target, 0x1413); break;
+ case PIPE_VIDEO_FORMAT_MPEG4: nv98_decoder_setup_ppp(dec, target, 0x1414); break;
+ case PIPE_VIDEO_FORMAT_VC1: ppp_caps = nv98_decoder_vc1_ppp(dec, desc.vc1, target); break;
+ case PIPE_VIDEO_FORMAT_MPEG4_AVC: nv98_decoder_setup_ppp(dec, target, 0x1413); break;
default: assert(0);
}
BEGIN_NV04(push, SUBC_PPP(0x734), 2);
struct nouveau_pushbuf *push = dec->pushbuf[1];
uint32_t bsp_addr, comm_addr, inter_addr, ucode_addr, pic_addr[17], last_addr, null_addr;
uint32_t slice_size, bucket_size, ring_size, i;
- enum pipe_video_codec codec = u_reduce_video_profile(dec->base.profile);
+ enum pipe_video_format codec = u_reduce_video_profile(dec->base.profile);
struct nouveau_bo *bsp_bo = dec->bsp_bo[comm_seq % NOUVEAU_VP3_VIDEO_QDEPTH];
struct nouveau_bo *inter_bo = dec->inter_bo[comm_seq & 1];
u32 fence_extra = 0, codec_extra = 0;
fence_extra = 4;
#endif
- if (codec == PIPE_VIDEO_CODEC_MPEG4_AVC) {
+ if (codec == PIPE_VIDEO_FORMAT_MPEG4_AVC) {
nouveau_vp3_inter_sizes(dec, desc.h264->slice_count, &slice_size, &bucket_size, &ring_size);
codec_extra += 2;
} else
if (!is_ref)
nv98_decoder_kick_ref(dec, target);
- nouveau_pushbuf_space(push, 8 + 3 * (codec != PIPE_VIDEO_CODEC_MPEG12) +
+ nouveau_pushbuf_space(push, 8 + 3 * (codec != PIPE_VIDEO_FORMAT_MPEG12) +
6 + codec_extra + fence_extra + 2, num_refs, 0);
nouveau_pushbuf_refn(push, bo_refs, num_refs);
}
}
- if (codec == PIPE_VIDEO_CODEC_MPEG4_AVC) {
+ if (codec == PIPE_VIDEO_FORMAT_MPEG4_AVC) {
BEGIN_NV04(push, SUBC_VP(0x438), 1);
PUSH_DATA (push, desc.h264->slice_count);
}
goto fail;
switch (u_reduce_video_profile(templ->profile)) {
- case PIPE_VIDEO_CODEC_MPEG12: {
+ case PIPE_VIDEO_FORMAT_MPEG12: {
codec = 1;
assert(templ->max_references <= 2);
break;
}
- case PIPE_VIDEO_CODEC_MPEG4: {
+ case PIPE_VIDEO_FORMAT_MPEG4: {
codec = 4;
tmp_size = mb(templ->height)*16 * mb(templ->width)*16;
assert(templ->max_references <= 2);
break;
}
- case PIPE_VIDEO_CODEC_VC1: {
+ case PIPE_VIDEO_FORMAT_VC1: {
ppp_codec = codec = 2;
tmp_size = mb(templ->height)*16 * mb(templ->width)*16;
assert(templ->max_references <= 2);
break;
}
- case PIPE_VIDEO_CODEC_MPEG4_AVC: {
+ case PIPE_VIDEO_FORMAT_MPEG4_AVC: {
codec = 3;
dec->tmp_stride = 16 * mb_half(templ->width) * nouveau_vp3_video_align(templ->height) * 3 / 2;
tmp_size = dec->tmp_stride * (templ->max_references + 1);
struct nouveau_vp3_video_buffer *refs[16])
{
struct nouveau_pushbuf *push = dec->pushbuf[0];
- enum pipe_video_codec codec = u_reduce_video_profile(dec->base.profile);
+ enum pipe_video_format codec = u_reduce_video_profile(dec->base.profile);
uint32_t bsp_addr, comm_addr, inter_addr;
uint32_t slice_size, bucket_size, ring_size;
uint32_t caps;
nouveau_vp3_vp_caps(dec, desc, target, comm_seq, vp_caps, is_ref, refs);
- nouveau_pushbuf_space(push, 6 + (codec == PIPE_VIDEO_CODEC_MPEG4_AVC ? 9 : 7) + fence_extra + 2, num_refs, 0);
+ nouveau_pushbuf_space(push, 6 + (codec == PIPE_VIDEO_FORMAT_MPEG4_AVC ? 9 : 7) + fence_extra + 2, num_refs, 0);
nouveau_pushbuf_refn(push, bo_refs, num_refs);
bsp_addr = bsp_bo->offset >> 8;
PUSH_DATA (push, comm_addr); // 70c comm
PUSH_DATA (push, comm_seq); // 710 seq
- if (codec != PIPE_VIDEO_CODEC_MPEG4_AVC) {
+ if (codec != PIPE_VIDEO_FORMAT_MPEG4_AVC) {
u32 bitplane_addr;
bitplane_addr = dec->bitplane_bo->offset >> 8;
void
nvc0_decoder_ppp(struct nouveau_vp3_decoder *dec, union pipe_desc desc, struct nouveau_vp3_video_buffer *target, unsigned comm_seq) {
- enum pipe_video_codec codec = u_reduce_video_profile(dec->base.profile);
+ enum pipe_video_format codec = u_reduce_video_profile(dec->base.profile);
struct nouveau_pushbuf *push = dec->pushbuf[2];
unsigned ppp_caps = 0x10;
unsigned fence_extra = 0;
fence_extra = 4;
#endif
- nouveau_pushbuf_space(push, 11 + (codec == PIPE_VIDEO_CODEC_VC1 ? 2 : 0) + 3 + fence_extra + 2, 4, 0);
+ nouveau_pushbuf_space(push, 11 + (codec == PIPE_VIDEO_FORMAT_VC1 ? 2 : 0) + 3 + fence_extra + 2, 4, 0);
switch (codec) {
- case PIPE_VIDEO_CODEC_MPEG12: {
+ case PIPE_VIDEO_FORMAT_MPEG12: {
unsigned mpeg2 = dec->base.profile != PIPE_VIDEO_PROFILE_MPEG1;
nvc0_decoder_setup_ppp(dec, target, 0x1410 | mpeg2);
break;
}
- case PIPE_VIDEO_CODEC_MPEG4: nvc0_decoder_setup_ppp(dec, target, 0x1414); break;
- case PIPE_VIDEO_CODEC_VC1: ppp_caps = nvc0_decoder_vc1_ppp(dec, desc.vc1, target); break;
- case PIPE_VIDEO_CODEC_MPEG4_AVC: nvc0_decoder_setup_ppp(dec, target, 0x1413); break;
+ case PIPE_VIDEO_FORMAT_MPEG4: nvc0_decoder_setup_ppp(dec, target, 0x1414); break;
+ case PIPE_VIDEO_FORMAT_VC1: ppp_caps = nvc0_decoder_vc1_ppp(dec, desc.vc1, target); break;
+ case PIPE_VIDEO_FORMAT_MPEG4_AVC: nvc0_decoder_setup_ppp(dec, target, 0x1413); break;
default: assert(0);
}
BEGIN_NVC0(push, SUBC_PPP(0x734), 2);
struct nouveau_pushbuf *push = dec->pushbuf[1];
uint32_t bsp_addr, comm_addr, inter_addr, ucode_addr, pic_addr[17], last_addr, null_addr;
uint32_t slice_size, bucket_size, ring_size, i;
- enum pipe_video_codec codec = u_reduce_video_profile(dec->base.profile);
+ enum pipe_video_format codec = u_reduce_video_profile(dec->base.profile);
struct nouveau_bo *bsp_bo = dec->bsp_bo[comm_seq % NOUVEAU_VP3_VIDEO_QDEPTH];
struct nouveau_bo *inter_bo = dec->inter_bo[comm_seq & 1];
u32 fence_extra = 0, codec_extra = 0;
fence_extra = 4;
#endif
- if (codec == PIPE_VIDEO_CODEC_MPEG4_AVC) {
+ if (codec == PIPE_VIDEO_FORMAT_MPEG4_AVC) {
nouveau_vp3_inter_sizes(dec, desc.h264->slice_count, &slice_size, &bucket_size, &ring_size);
codec_extra += 2;
} else
if (!is_ref)
nvc0_decoder_kick_ref(dec, target);
- nouveau_pushbuf_space(push, 8 + 3 * (codec != PIPE_VIDEO_CODEC_MPEG12) +
+ nouveau_pushbuf_space(push, 8 + 3 * (codec != PIPE_VIDEO_FORMAT_MPEG12) +
6 + codec_extra + fence_extra + 2, num_refs, 0);
nouveau_pushbuf_refn(push, bo_refs, num_refs);
}
}
- if (codec == PIPE_VIDEO_CODEC_MPEG4_AVC) {
+ if (codec == PIPE_VIDEO_FORMAT_MPEG4_AVC) {
BEGIN_NVC0(push, SUBC_VP(0x438), 1);
PUSH_DATA (push, desc.h264->slice_count);
}
/* UVD 2.x limits */
if (rscreen->family < CHIP_PALM) {
- enum pipe_video_codec codec = u_reduce_video_profile(profile);
+ enum pipe_video_format codec = u_reduce_video_profile(profile);
switch (param) {
case PIPE_VIDEO_CAP_SUPPORTED:
/* no support for MPEG4 */
- return codec != PIPE_VIDEO_CODEC_MPEG4;
+ return codec != PIPE_VIDEO_FORMAT_MPEG4;
case PIPE_VIDEO_CAP_PREFERS_INTERLACED:
case PIPE_VIDEO_CAP_SUPPORTS_INTERLACED:
/* and MPEG2 only with shaders */
- return codec != PIPE_VIDEO_CODEC_MPEG12;
+ return codec != PIPE_VIDEO_FORMAT_MPEG12;
default:
break;
}
static uint32_t profile2stream_type(enum pipe_video_profile profile)
{
switch (u_reduce_video_profile(profile)) {
- case PIPE_VIDEO_CODEC_MPEG4_AVC:
+ case PIPE_VIDEO_FORMAT_MPEG4_AVC:
return RUVD_CODEC_H264;
- case PIPE_VIDEO_CODEC_VC1:
+ case PIPE_VIDEO_FORMAT_VC1:
return RUVD_CODEC_VC1;
- case PIPE_VIDEO_CODEC_MPEG12:
+ case PIPE_VIDEO_FORMAT_MPEG12:
return RUVD_CODEC_MPEG2;
- case PIPE_VIDEO_CODEC_MPEG4:
+ case PIPE_VIDEO_FORMAT_MPEG4:
return RUVD_CODEC_MPEG4;
default:
height_in_mb = align(height / VL_MACROBLOCK_HEIGHT, 2);
switch (u_reduce_video_profile(templ->profile)) {
- case PIPE_VIDEO_CODEC_MPEG4_AVC:
+ case PIPE_VIDEO_FORMAT_MPEG4_AVC:
// the firmware seems to allways assume a minimum of ref frames
max_references = MAX2(NUM_H264_REFS, max_references);
dpb_size += width_in_mb * height_in_mb * 32;
break;
- case PIPE_VIDEO_CODEC_VC1:
+ case PIPE_VIDEO_FORMAT_VC1:
// reference picture buffer
dpb_size = image_size * max_references;
dpb_size += align(MAX2(width_in_mb, height_in_mb) * 7 * 16, 64);
break;
- case PIPE_VIDEO_CODEC_MPEG12:
+ case PIPE_VIDEO_FORMAT_MPEG12:
// reference picture buffer, must be big enough for all frames
dpb_size = image_size * NUM_MPEG2_REFS;
break;
- case PIPE_VIDEO_CODEC_MPEG4:
+ case PIPE_VIDEO_FORMAT_MPEG4:
// reference picture buffer
dpb_size = image_size * max_references;
dt = dec->set_dtb(&msg, (struct vl_video_buffer *)target);
switch (u_reduce_video_profile(picture->profile)) {
- case PIPE_VIDEO_CODEC_MPEG4_AVC:
+ case PIPE_VIDEO_FORMAT_MPEG4_AVC:
msg.body.decode.codec.h264 = get_h264_msg(dec, (struct pipe_h264_picture_desc*)picture);
break;
- case PIPE_VIDEO_CODEC_VC1:
+ case PIPE_VIDEO_FORMAT_VC1:
msg.body.decode.codec.vc1 = get_vc1_msg((struct pipe_vc1_picture_desc*)picture);
break;
- case PIPE_VIDEO_CODEC_MPEG12:
+ case PIPE_VIDEO_FORMAT_MPEG12:
msg.body.decode.codec.mpeg2 = get_mpeg2_msg(dec, (struct pipe_mpeg12_picture_desc*)picture);
break;
- case PIPE_VIDEO_CODEC_MPEG4:
+ case PIPE_VIDEO_FORMAT_MPEG4:
msg.body.decode.codec.mpeg4 = get_mpeg4_msg(dec, (struct pipe_mpeg4_picture_desc*)picture);
break;
ws->query_info(ws, &info);
switch(u_reduce_video_profile(templ->profile)) {
- case PIPE_VIDEO_CODEC_MPEG12:
+ case PIPE_VIDEO_FORMAT_MPEG12:
if (templ->entrypoint > PIPE_VIDEO_ENTRYPOINT_BITSTREAM || info.family < CHIP_PALM)
return vl_create_mpeg12_decoder(context, templ);
/* fall through */
- case PIPE_VIDEO_CODEC_MPEG4:
- case PIPE_VIDEO_CODEC_MPEG4_AVC:
+ case PIPE_VIDEO_FORMAT_MPEG4:
+ case PIPE_VIDEO_FORMAT_MPEG4_AVC:
width = align(width, VL_MACROBLOCK_WIDTH);
height = align(height, VL_MACROBLOCK_HEIGHT);
break;
switch (param) {
case PIPE_VIDEO_CAP_SUPPORTED:
switch (u_reduce_video_profile(profile)) {
- case PIPE_VIDEO_CODEC_MPEG12:
- case PIPE_VIDEO_CODEC_MPEG4:
- case PIPE_VIDEO_CODEC_MPEG4_AVC:
- case PIPE_VIDEO_CODEC_VC1:
+ case PIPE_VIDEO_FORMAT_MPEG12:
+ case PIPE_VIDEO_FORMAT_MPEG4:
+ case PIPE_VIDEO_FORMAT_MPEG4_AVC:
+ case PIPE_VIDEO_FORMAT_VC1:
return true;
default:
return false;
#ifndef PIPE_VIDEO_ENUMS_H
#define PIPE_VIDEO_ENUMS_H
+enum pipe_video_format
+{
+ PIPE_VIDEO_FORMAT_UNKNOWN = 0,
+ PIPE_VIDEO_FORMAT_MPEG12, /**< MPEG1, MPEG2 */
+ PIPE_VIDEO_FORMAT_MPEG4, /**< DIVX, XVID */
+ PIPE_VIDEO_FORMAT_VC1, /**< WMV */
+ PIPE_VIDEO_FORMAT_MPEG4_AVC /**< H.264 */
+};
+
enum pipe_video_profile
{
PIPE_VIDEO_PROFILE_UNKNOWN,
PIPE_VIDEO_CAP_MAX_LEVEL = 8
};
-enum pipe_video_codec
-{
- PIPE_VIDEO_CODEC_UNKNOWN = 0,
- PIPE_VIDEO_CODEC_MPEG12, /**< MPEG1, MPEG2 */
- PIPE_VIDEO_CODEC_MPEG4, /**< DIVX, XVID */
- PIPE_VIDEO_CODEC_VC1, /**< WMV */
- PIPE_VIDEO_CODEC_MPEG4_AVC /**< H.264 */
-};
-
enum pipe_video_entrypoint
{
PIPE_VIDEO_ENTRYPOINT_UNKNOWN,
struct pipe_quant_matrix
{
- enum pipe_video_codec codec;
+ enum pipe_video_format codec;
};
struct pipe_macroblock
{
- enum pipe_video_codec codec;
+ enum pipe_video_format codec;
};
struct pipe_mpeg12_picture_desc
memset(&desc, 0, sizeof(desc));
desc.base.profile = dec->profile;
switch (u_reduce_video_profile(dec->profile)) {
- case PIPE_VIDEO_CODEC_MPEG12:
+ case PIPE_VIDEO_FORMAT_MPEG12:
ret = vlVdpDecoderRenderMpeg12(&desc.mpeg12, (VdpPictureInfoMPEG1Or2 *)picture_info);
break;
- case PIPE_VIDEO_CODEC_MPEG4:
+ case PIPE_VIDEO_FORMAT_MPEG4:
ret = vlVdpDecoderRenderMpeg4(&desc.mpeg4, (VdpPictureInfoMPEG4Part2 *)picture_info);
break;
- case PIPE_VIDEO_CODEC_VC1:
+ case PIPE_VIDEO_FORMAT_VC1:
if (dec->profile == PIPE_VIDEO_PROFILE_VC1_ADVANCED)
vlVdpDecoderFixVC1Startcode(&bitstream_buffer_count, buffers, sizes);
ret = vlVdpDecoderRenderVC1(&desc.vc1, (VdpPictureInfoVC1 *)picture_info);
break;
- case PIPE_VIDEO_CODEC_MPEG4_AVC:
+ case PIPE_VIDEO_FORMAT_MPEG4_AVC:
ret = vlVdpDecoderRenderH264(&desc.h264, (VdpPictureInfoH264 *)picture_info);
break;
default:
assert(num_macroblocks);
for (; num_macroblocks > 0; --num_macroblocks) {
- mb->base.codec = PIPE_VIDEO_CODEC_MPEG12;
+ mb->base.codec = PIPE_VIDEO_FORMAT_MPEG12;
mb->x = xvmc_mb->x;
mb->y = xvmc_mb->y;
mb->macroblock_type = xvmc_mb->macroblock_type;