summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2013-08-01 12:50:10 -0400
committerMaarten Lankhorst <[email protected]>2013-08-03 12:52:04 +0200
commit8edb79f1ef95581c20ed0c3dc49aabe99d7f072a (patch)
tree38f5e4afc776b4085e4d875a8e69617b435e84c1 /src
parentbff0d87668538196a2d3ef1400382e4deb0e0435 (diff)
nv50: fix some h264 interlaced decoding on vp2
Some videos specify mb_adaptive_frame_field_flag instead of field_pic_flag. This implies that the pic height needs to be halved, and this field needs to be passed to the VP engine. Cc: "9.2" [email protected] Signed-off-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/nv50/nv84_video_bsp.c3
-rw-r--r--src/gallium/drivers/nv50/nv84_video_vp.c12
2 files changed, 8 insertions, 7 deletions
diff --git a/src/gallium/drivers/nv50/nv84_video_bsp.c b/src/gallium/drivers/nv50/nv84_video_bsp.c
index 7885210e94d..28ba90f34dc 100644
--- a/src/gallium/drivers/nv50/nv84_video_bsp.c
+++ b/src/gallium/drivers/nv50/nv84_video_bsp.c
@@ -136,12 +136,11 @@ nv84_decoder_bsp(struct nv84_decoder *dec,
params.iseqparm.chroma_format_idc = 1;
params.iseqparm.pic_width_in_mbs_minus1 = mb(dec->base.width) - 1;
- if (desc->field_pic_flag)
+ if (desc->field_pic_flag || desc->mb_adaptive_frame_field_flag)
params.iseqparm.pic_height_in_map_units_minus1 = mb_half(dec->base.height) - 1;
else
params.iseqparm.pic_height_in_map_units_minus1 = mb(dec->base.height) - 1;
- /* TODO: interlaced still doesn't work, maybe due to ref frame management. */
if (desc->bottom_field_flag)
params.ipicparm.curr_pic_order_cnt = desc->field_order_cnt[1];
else
diff --git a/src/gallium/drivers/nv50/nv84_video_vp.c b/src/gallium/drivers/nv50/nv84_video_vp.c
index e968546ae7b..581361b71d7 100644
--- a/src/gallium/drivers/nv50/nv84_video_vp.c
+++ b/src/gallium/drivers/nv50/nv84_video_vp.c
@@ -39,10 +39,10 @@ struct h264_iparm1 {
uint32_t h1; // 1fc
uint32_t h2; // 200
uint32_t h3; // 204
- uint32_t unk208;
- uint32_t field_pic_flag;
- uint32_t format;
- uint32_t unk214;
+ uint32_t mb_adaptive_frame_field_flag; // 208
+ uint32_t field_pic_flag; // 20c
+ uint32_t format; // 210
+ uint32_t unk214; // 214
};
struct h264_iparm2 {
@@ -56,7 +56,7 @@ struct h264_iparm2 {
uint32_t h2; // 1c
uint32_t h3; // 20
uint32_t unk24;
- uint32_t unk28;
+ uint32_t mb_adaptive_frame_field_flag; // 28
uint32_t top; // 2c
uint32_t bottom; // 30
uint32_t is_reference; // 34
@@ -100,6 +100,7 @@ nv84_decoder_vp_h264(struct nv84_decoder *dec,
param1.height = param1.h2 = height;
param1.h1 = param1.h3 = align(height, 32);
param1.format = 0x3231564e; /* 'NV12' */
+ param1.mb_adaptive_frame_field_flag = desc->mb_adaptive_frame_field_flag;
param1.field_pic_flag = desc->field_pic_flag;
param2.width = width;
@@ -115,6 +116,7 @@ nv84_decoder_vp_h264(struct nv84_decoder *dec,
param2.top = desc->bottom_field_flag ? 2 : 1;
param2.bottom = desc->bottom_field_flag;
}
+ param2.mb_adaptive_frame_field_flag = desc->mb_adaptive_frame_field_flag;
param2.is_reference = desc->is_reference;
PUSH_SPACE(push, 5 + 16 + 3 + 2 + 6 + (is_ref ? 2 : 0) + 3 + 2 + 4 + 2);