added crop offset info

This commit is contained in:
georgemoralis 2024-11-08 09:34:40 +02:00
parent 48378d6d14
commit 5739e126d0
2 changed files with 14 additions and 0 deletions

View File

@ -44,6 +44,7 @@ int PS4_SYSV_ABI sceVideodecDecode(OrbisVideodecCtrl* pCtrlIn,
pFrameBufferInOut->thisSize != sizeof(OrbisVideodecFrameBuffer)) {
return ORBIS_VIDEODEC_ERROR_STRUCT_SIZE;
}
VdecDecoder* decoder = (VdecDecoder*)pCtrlIn->handle;
if (!decoder) {
return ORBIS_VIDEODEC_ERROR_HANDLE;
@ -53,6 +54,7 @@ int PS4_SYSV_ABI sceVideodecDecode(OrbisVideodecCtrl* pCtrlIn,
int PS4_SYSV_ABI sceVideodecDeleteDecoder(OrbisVideodecCtrl* pCtrlIn) {
LOG_INFO(Lib_Videodec, "(STUBBED) called");
VdecDecoder* decoder = (VdecDecoder*)pCtrlIn->handle;
if (!decoder) {
return ORBIS_VIDEODEC_ERROR_HANDLE;
@ -73,6 +75,7 @@ int PS4_SYSV_ABI sceVideodecFlush(OrbisVideodecCtrl* pCtrlIn,
pPictureInfoOut->thisSize != sizeof(OrbisVideodecPictureInfo)) {
return ORBIS_VIDEODEC_ERROR_STRUCT_SIZE;
}
VdecDecoder* decoder = (VdecDecoder*)pCtrlIn->handle;
if (!decoder) {
return ORBIS_VIDEODEC_ERROR_HANDLE;
@ -112,6 +115,7 @@ int PS4_SYSV_ABI sceVideodecQueryResourceInfo(const OrbisVideodecConfigInfo* pCf
int PS4_SYSV_ABI sceVideodecReset(OrbisVideodecCtrl* pCtrlIn) {
LOG_INFO(Lib_Videodec, "(STUBBED) called");
VdecDecoder* decoder = (VdecDecoder*)pCtrlIn->handle;
decoder->Reset();
return ORBIS_OK;

View File

@ -156,6 +156,16 @@ s32 VdecDecoder::Flush(OrbisVideodecFrameBuffer& pFrameBufferInOut,
pPictureInfoOut.isValid = true;
pPictureInfoOut.isErrorPic = false;
u32 width = Common::AlignUp((u32)frame->width, 16);
u32 height = Common::AlignUp((u32)frame->height, 16);
pPictureInfoOut.codec.avc.frameCropLeftOffset = u32(frame->crop_left);
pPictureInfoOut.codec.avc.frameCropRightOffset =
u32(frame->crop_right + (width - frame->width));
pPictureInfoOut.codec.avc.frameCropTopOffset = u32(frame->crop_top);
pPictureInfoOut.codec.avc.frameCropBottomOffset =
u32(frame->crop_bottom + (height - frame->height));
// TODO maybe more avc?
}
av_frame_free(&frame);