radeon/vce: use nblk_y instead of npix_y
npix_y will be removed. level[0].npix_y will be removed too. nblk_y should be the same as npix_y if the block height == 1. However, nblk_y is aligned to the tile size, so it can be greater than npix_y. If that's a problem, we'll have to save the input height of surface_init and use that. Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
@@ -224,7 +224,7 @@ void rvce_frame_offset(struct rvce_encoder *enc, struct rvce_cpb_slot *slot,
|
||||
signed *luma_offset, signed *chroma_offset)
|
||||
{
|
||||
unsigned pitch = align(enc->luma->level[0].pitch_bytes, 128);
|
||||
unsigned vpitch = align(enc->luma->npix_y, 16);
|
||||
unsigned vpitch = align(enc->luma->level[0].nblk_y, 16);
|
||||
unsigned fsize = pitch * (vpitch + vpitch / 2);
|
||||
|
||||
*luma_offset = slot->index * fsize;
|
||||
@@ -455,7 +455,7 @@ struct pipe_video_codec *rvce_create_encoder(struct pipe_context *context,
|
||||
|
||||
get_buffer(((struct vl_video_buffer *)tmp_buf)->resources[0], NULL, &tmp_surf);
|
||||
cpb_size = align(tmp_surf->level[0].pitch_bytes, 128);
|
||||
cpb_size = cpb_size * align(tmp_surf->npix_y, 32);
|
||||
cpb_size = cpb_size * align(tmp_surf->level[0].nblk_y, 32);
|
||||
cpb_size = cpb_size * 3 / 2;
|
||||
cpb_size = cpb_size * enc->cpb_num;
|
||||
if (enc->dual_pipe)
|
||||
|
||||
@@ -96,7 +96,7 @@ static void create(struct rvce_encoder *enc)
|
||||
RVCE_CS(enc->base.height); // encImageHeight
|
||||
RVCE_CS(enc->luma->level[0].pitch_bytes); // encRefPicLumaPitch
|
||||
RVCE_CS(enc->chroma->level[0].pitch_bytes); // encRefPicChromaPitch
|
||||
RVCE_CS(align(enc->luma->npix_y, 16) / 8); // encRefYHeightInQw
|
||||
RVCE_CS(align(enc->luma->level[0].nblk_y, 16) / 8); // encRefYHeightInQw
|
||||
RVCE_CS(0x00000000); // encRefPic(Addr|Array)Mode, encPicStructRestriction, disableRDO
|
||||
RVCE_END();
|
||||
}
|
||||
@@ -323,7 +323,7 @@ static void encode(struct rvce_encoder *enc)
|
||||
enc->luma->level[0].offset); // inputPictureLumaAddressHi/Lo
|
||||
RVCE_READ(enc->handle, RADEON_DOMAIN_VRAM,
|
||||
enc->chroma->level[0].offset); // inputPictureChromaAddressHi/Lo
|
||||
RVCE_CS(align(enc->luma->npix_y, 16)); // encInputFrameYPitch
|
||||
RVCE_CS(align(enc->luma->level[0].nblk_y, 16)); // encInputFrameYPitch
|
||||
RVCE_CS(enc->luma->level[0].pitch_bytes); // encInputPicLumaPitch
|
||||
RVCE_CS(enc->chroma->level[0].pitch_bytes); // encInputPicChromaPitch
|
||||
RVCE_CS(0x00000000); // encInputPic(Addr|Array)Mode
|
||||
|
||||
@@ -130,7 +130,7 @@ static void encode(struct rvce_encoder *enc)
|
||||
enc->luma->level[0].offset); // inputPictureLumaAddressHi/Lo
|
||||
RVCE_READ(enc->handle, RADEON_DOMAIN_VRAM,
|
||||
enc->chroma->level[0].offset); // inputPictureChromaAddressHi/Lo
|
||||
RVCE_CS(align(enc->luma->npix_y, 16)); // encInputFrameYPitch
|
||||
RVCE_CS(align(enc->luma->level[0].nblk_y, 16)); // encInputFrameYPitch
|
||||
RVCE_CS(enc->luma->level[0].pitch_bytes); // encInputPicLumaPitch
|
||||
RVCE_CS(enc->chroma->level[0].pitch_bytes); // encInputPicChromaPitch
|
||||
if (enc->dual_pipe)
|
||||
|
||||
@@ -179,7 +179,7 @@ static void create(struct rvce_encoder *enc)
|
||||
RVCE_CS(enc->base.height); // encImageHeight
|
||||
RVCE_CS(enc->luma->level[0].pitch_bytes); // encRefPicLumaPitch
|
||||
RVCE_CS(enc->chroma->level[0].pitch_bytes); // encRefPicChromaPitch
|
||||
RVCE_CS(align(enc->luma->npix_y, 16) / 8); // encRefYHeightInQw
|
||||
RVCE_CS(align(enc->luma->level[0].nblk_y, 16) / 8); // encRefYHeightInQw
|
||||
RVCE_CS(enc->enc_pic.addrmode_arraymode_disrdo_distwoinstants);
|
||||
|
||||
RVCE_CS(enc->enc_pic.ec.enc_pre_encode_context_buffer_offset);
|
||||
@@ -243,7 +243,7 @@ static void encode(struct rvce_encoder *enc)
|
||||
enc->luma->level[0].offset); // inputPictureLumaAddressHi/Lo
|
||||
RVCE_READ(enc->handle, RADEON_DOMAIN_VRAM,
|
||||
enc->chroma->level[0].offset); // inputPictureChromaAddressHi/Lo
|
||||
RVCE_CS(align(enc->luma->npix_y, 16)); // encInputFrameYPitch
|
||||
RVCE_CS(align(enc->luma->level[0].nblk_y, 16)); // encInputFrameYPitch
|
||||
RVCE_CS(enc->luma->level[0].pitch_bytes); // encInputPicLumaPitch
|
||||
RVCE_CS(enc->chroma->level[0].pitch_bytes); // encInputPicChromaPitch
|
||||
if (enc->dual_pipe)
|
||||
|
||||
Reference in New Issue
Block a user