aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon
diff options
context:
space:
mode:
authorChristian König <[email protected]>2014-04-04 14:22:16 +0200
committerChristian König <[email protected]>2014-04-11 11:35:03 +0200
commitd7d41ce133fa7369f7a5ea12bfc971c5ecafb3ba (patch)
treef556cf9fdfbd67c8246141cdaffb46ae89ba4e41 /src/gallium/drivers/radeon
parentee4439c562e88446b94fbb98e9d02ad105efc01e (diff)
vl: add interface for H264 B-frame encoding
Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon')
-rw-r--r--src/gallium/drivers/radeon/radeon_vce_40_2_2.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gallium/drivers/radeon/radeon_vce_40_2_2.c b/src/gallium/drivers/radeon/radeon_vce_40_2_2.c
index c41b2d03ab8..33a58f3e8e9 100644
--- a/src/gallium/drivers/radeon/radeon_vce_40_2_2.c
+++ b/src/gallium/drivers/radeon/radeon_vce_40_2_2.c
@@ -156,8 +156,8 @@ static void pic_control(struct rvce_encoder *enc)
RVCE_CS(0x00000040); // encConstraintSetFlags
RVCE_CS(0x00000000); // encBPicPattern
RVCE_CS(0x00000000); // weightPredModeBPicture
- RVCE_CS(0x00000001); // encNumberOfReferenceFrames
- RVCE_CS(0x00000001); // encMaxNumRefFrames
+ RVCE_CS(MIN2(enc->base.max_references, 2)); // encNumberOfReferenceFrames
+ RVCE_CS(enc->base.max_references + 1); // encMaxNumRefFrames
RVCE_CS(0x00000000); // encNumDefaultActiveRefL0
RVCE_CS(0x00000000); // encNumDefaultActiveRefL1
RVCE_CS(0x00000000); // encSliceMode
@@ -297,8 +297,9 @@ static void encode(struct rvce_encoder *enc)
RVCE_CS(0xffffffff); // chromaOffset
}
else if(enc->pic.picture_type == PIPE_H264_ENC_PICTURE_TYPE_P) {
- frame_offset(enc, enc->pic.frame_num - 1, &luma_offset, &chroma_offset);
+ frame_offset(enc, enc->pic.ref_idx_l0, &luma_offset, &chroma_offset);
RVCE_CS(0x00000000); // encPicType
+ // TODO: Stores these in the CPB backtrack
RVCE_CS(enc->pic.frame_num - 1); // frameNumber
RVCE_CS(enc->pic.frame_num - 1); // pictureOrderCount
RVCE_CS(luma_offset); // lumaOffset
@@ -322,8 +323,8 @@ static void encode(struct rvce_encoder *enc)
RVCE_CS(0x00000000); // encReferenceRefBasePictureLumaOffset
RVCE_CS(0x00000000); // encReferenceRefBasePictureChromaOffset
RVCE_CS(0x00000000); // pictureCount
- RVCE_CS(0x00000000); // frameNumber
- RVCE_CS(0x00000000); // pictureOrderCount
+ RVCE_CS(enc->pic.frame_num); // frameNumber
+ RVCE_CS(enc->pic.pic_order_cnt); // pictureOrderCount
RVCE_CS(0x00000000); // numIPicRemainInRCGOP
RVCE_CS(0x00000000); // numPPicRemainInRCGOP
RVCE_CS(0x00000000); // numBPicRemainInRCGOP