Skip to content

Videocodec implementation #1484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Nov 10, 2024
Merged

Videocodec implementation #1484

merged 10 commits into from
Nov 10, 2024

Conversation

georgemoralis
Copy link
Collaborator

Based on @polybiusproxy videodec2 implementation . Seems to work , reply with tests thanks :D

@bigol83
Copy link
Contributor

bigol83 commented Nov 5, 2024

Resident Evil 4 2005 fmv works without issues

Immagine 2024-11-05 124118

@ElBread3
Copy link
Contributor

ElBread3 commented Nov 5, 2024

think this could be rebased so I can test with ajm?

@georgemoralis
Copy link
Collaborator Author

done

@polybiusproxy polybiusproxy self-requested a review November 5, 2024 16:05
Copy link
Contributor

@polybiusproxy polybiusproxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good at first glance, I do have a few nits though.

To start, this one is quite personal, I quite dislike the lack of empty newlines on some functions--to take one example:

int PS4_SYSV_ABI sceVideodecFlush(OrbisVideodecCtrl* pCtrlIn,
                                  OrbisVideodecFrameBuffer* pFrameBufferInOut,
                                  OrbisVideodecPictureInfo* pPictureInfoOut) {
    LOG_INFO(Lib_Videodec, "called");

    if (!pFrameBufferInOut || !pPictureInfoOut) {
        return ORBIS_VIDEODEC_ERROR_ARGUMENT_POINTER;
    }
    if (pFrameBufferInOut->thisSize != sizeof(OrbisVideodecFrameBuffer) ||
        pPictureInfoOut->thisSize != sizeof(OrbisVideodecPictureInfo)) {
        return ORBIS_VIDEODEC_ERROR_STRUCT_SIZE;
    }
    VdecDecoder* decoder = (VdecDecoder*)pCtrlIn->handle;
    if (!decoder) {
        return ORBIS_VIDEODEC_ERROR_HANDLE;
    }
    return decoder->Flush(*pFrameBufferInOut, *pPictureInfoOut);
}

I believe it would look better this way:

int PS4_SYSV_ABI sceVideodecFlush(OrbisVideodecCtrl* pCtrlIn,
                                  OrbisVideodecFrameBuffer* pFrameBufferInOut,
                                  OrbisVideodecPictureInfo* pPictureInfoOut) {
    LOG_INFO(Lib_Videodec, "called");

    if (!pFrameBufferInOut || !pPictureInfoOut) {
        return ORBIS_VIDEODEC_ERROR_ARGUMENT_POINTER;
    }
    if (pFrameBufferInOut->thisSize != sizeof(OrbisVideodecFrameBuffer) ||
        pPictureInfoOut->thisSize != sizeof(OrbisVideodecPictureInfo)) {
        return ORBIS_VIDEODEC_ERROR_STRUCT_SIZE;
    }

    VdecDecoder* decoder = (VdecDecoder*)pCtrlIn->handle;
    if (!decoder) {
        return ORBIS_VIDEODEC_ERROR_HANDLE;
    }

    return decoder->Flush(*pFrameBufferInOut, *pPictureInfoOut);
}

clang-format doesn't mind it, but I do.

Secondly, I ask you to change the names of function arguments and struct members to avoid using Hungarian notation which would go against the whole code style from the emulator, so rename things like pPictureInfoOut to pictureInfo. It wouldn't make sense either way since you're also using it on references.

Finally, since this class is named VdecDecoder, to avoid confusion I believe we should either change the Vdec2 implementation class's name to Vdec2Decoder or make a common class for both classes to inherit from.

@georgemoralis georgemoralis merged commit 7ab8515 into main Nov 10, 2024
19 checks passed
fpiesche pushed a commit to fpiesche/shadPS4 that referenced this pull request Nov 12, 2024
* dummy videocodec

* filled videodec parameters

* vdec1 implementation

* clang format fix

* fixed codecType

* added crop offset info

* align output

* align all h/w

* some touchups

* small touch (last one)
fpiesche pushed a commit to fpiesche/shadPS4 that referenced this pull request Nov 12, 2024
* dummy videocodec

* filled videodec parameters

* vdec1 implementation

* clang format fix

* fixed codecType

* added crop offset info

* align output

* align all h/w

* some touchups

* small touch (last one)
fpiesche pushed a commit to fpiesche/shadPS4 that referenced this pull request Nov 12, 2024
* dummy videocodec

* filled videodec parameters

* vdec1 implementation

* clang format fix

* fixed codecType

* added crop offset info

* align output

* align all h/w

* some touchups

* small touch (last one)
@georgemoralis georgemoralis deleted the videocodec1 branch November 19, 2024 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants