nn_codec_hwopus

Family of src/nx/nn/codec.hook. The hooks_off setting turns a family off by its name.

The native nn::codec hardware Opus decoder (codec.c), for tools/hookgen, in the language of nn/hooks.hook. With no hwopus session: every function that asks the session for a decoder, a decode, a close or a work buffer's size. The names and the session's command behind each changed between SDKs, read in an SDK of every major version from 0 to 20 but 2 and in SDKs 21.4.0, 21.4.4 and 22.2.8 (Ounce games', #1999 and #2078), by what each function calls and what it loads and stores through its object: - up to SDK 4 (0.12.14, 1.3.1, 3.5.0, 4.4.0, 4.4.1, 4.5.0) the HardwareOpusDecoder class's methods, and from 3 the HardwareOpusMultiStreamDecoder's. SDK 0.12's DecodeInterleaved leaves the output's room to the session; - from SDK 5 (5.4.180 to 22.2.8) the functions over a HardwareOpusDecoderType, which the class's Initialize and DecodeInterleaved call until the class goes (SDK 15); its Finalize and its multistream GetWorkBufferSize are code of their own. SDK 5 keeps no decode time and no reset flag in the struct; - the work buffer's size is the session's plain command up to SDK 11, the one with an option from 12 and the one that leaves the decoder's state out from 16; - SDK 21's and 22's functions are 16 to 20's: the same loads and stores through the struct, only some compares' and orrs' operands commuted in 21. The game of #1999 runs on SDK 22 with these handlers. FinalizeHardwareOpusDecoder and ResetHardwareOpusDecoder of a HardwareOpusDecoderType are in nn/hooks.hook's codec family: the Ounce's SDK has the same two symbols for its hwacod decoders, and their handlers (codec.c's hwacod section) hand a decoder that isn't hwacod's to these. The getters and the other resets are the SDK's own code over the game's struct. InitializeHardwareOpusMultiStreamDecoder's last argument, an option, comes on the stack and is not declared: nothing of it is read. A 32-bit game: read in SDK 10.6.0, and held from 6.0.0 below 11.0.0 (a32 @version), where the 64-bit SDKs read keep the struct with its time and its flag and the plain work buffer size (hwopus's Ex commands begin at 12.0.0 on switchbrew); its functions are SDK 6 to 11's over a struct of 4-byte pointers (codec.c's 32-bit shapes, which the handlers take in a 32-bit game): the ones with a size_t (j) have another symbol there, and an a32 hook of their own; the others are marked a32. The class's Initialize, its DecodeInterleaved and the single decoder's GetWorkBufferSize call the struct's functions, as in 64 bits. A 32-bit game of another SDK has no hook here

Page 1 2 3

nn::codec::HardwareOpusDecoder::Initialize(int, int, void*, unsigned long) SDK < 2.0.0 source

_ZN2nn5codec19HardwareOpusDecoder10InitializeEiiPvm
As C: u32 (addr self, i32 rate, i32 channels, addr work, usize size)
Handler: nncodec_hwopus_class_init (codec.c)

nn::codec::HardwareOpusDecoder::SetContext(void const*, unsigned long) SDK < 2.0.0 source

_ZN2nn5codec19HardwareOpusDecoder10SetContextEPKvm
As C: u32 (addr self, addr context, usize size)
Handler: nncodec_hwopus_class_set_context (codec.c)

nn::codec::HardwareOpusDecoder::Finalize() SDK < 2.0.0 source

_ZN2nn5codec19HardwareOpusDecoder8FinalizeEv
As C: void (addr self)
Handler: nncodec_hwopus_class_finalize (codec.c)

nn::codec::HardwareOpusDecoder::GetWorkBufferSize(int, int) const SDK < 2.0.0 source

_ZNK2nn5codec19HardwareOpusDecoder17GetWorkBufferSizeEii
As C: usize (addr self, i32 rate, i32 channels)
Handler: nncodec_hwopus_class_work_size (codec.c)

nn::codec::HardwareOpusDecoder::Initialize(int, int, void*, unsigned long) SDK >= 3.0.0, < 5.0.0 source

_ZN2nn5codec19HardwareOpusDecoder10InitializeEiiPvm
As C: u32 (addr self, i32 rate, i32 channels, addr work, usize size)
Handler: nncodec_hwopus_class_init (codec.c)

nn::codec::HardwareOpusDecoder::SetContext(void const*, unsigned long) SDK >= 3.0.0, < 5.0.0 source

_ZN2nn5codec19HardwareOpusDecoder10SetContextEPKvm
As C: u32 (addr self, addr context, usize size)
Handler: nncodec_hwopus_class_set_context (codec.c)

nn::codec::HardwareOpusDecoder::Finalize() SDK >= 3.0.0, < 5.0.0 source

_ZN2nn5codec19HardwareOpusDecoder8FinalizeEv
As C: void (addr self)
Handler: nncodec_hwopus_class_finalize (codec.c)

nn::codec::HardwareOpusDecoder::GetWorkBufferSize(int, int) const SDK >= 3.0.0, < 5.0.0 source

_ZNK2nn5codec19HardwareOpusDecoder17GetWorkBufferSizeEii
As C: usize (addr self, i32 rate, i32 channels)
Handler: nncodec_hwopus_class_work_size (codec.c)

nn::codec::HardwareOpusDecoder::DecodeInterleaved(unsigned long*, int*, short*, unsigned long, void const*, unsigned long) SDK < 1.0.0 source

_ZN2nn5codec19HardwareOpusDecoder17DecodeInterleavedEPmPiPsmPKvm
As C: u32 (addr self, addr consumed, addr samples, addr out, usize out_size, addr in, usize in_size)
Handler: nncodec_hwopus_class_decode_first (codec.c)

nn::codec::HardwareOpusDecoder::DecodeInterleaved(unsigned long*, int*, short*, unsigned long, void const*, unsigned long) SDK >= 1.0.0, < 2.0.0 source

_ZN2nn5codec19HardwareOpusDecoder17DecodeInterleavedEPmPiPsmPKvm
As C: u32 (addr self, addr consumed, addr samples, addr out, usize out_size, addr in, usize in_size)
Handler: nncodec_hwopus_class_decode (codec.c)

nn::codec::HardwareOpusDecoder::DecodeInterleaved(unsigned long*, int*, short*, unsigned long, void const*, unsigned long) SDK >= 3.0.0, < 5.0.0 source

_ZN2nn5codec19HardwareOpusDecoder17DecodeInterleavedEPmPiPsmPKvm
As C: u32 (addr self, addr consumed, addr samples, addr out, usize out_size, addr in, usize in_size)
Handler: nncodec_hwopus_class_decode (codec.c)

nn::codec::HardwareOpusMultiStreamDecoder::Initialize(int, int, int, int, unsigned char const*, void*, unsigned long) SDK >= 3.0.0, < 5.0.0 source

_ZN2nn5codec30HardwareOpusMultiStreamDecoder10InitializeEiiiiPKhPvm
As C: u32 (addr self, i32 rate, i32 channels, i32 streams, i32 stereo_streams, addr mapping, addr work, usize size)
Handler: nncodec_hwopus_class_multi_init (codec.c)

nn::codec::HardwareOpusMultiStreamDecoder::SetContext(void const*, unsigned long) SDK >= 3.0.0, < 5.0.0 source

_ZN2nn5codec30HardwareOpusMultiStreamDecoder10SetContextEPKvm
As C: u32 (addr self, addr context, usize size)
Handler: nncodec_hwopus_class_set_context (codec.c)

nn::codec::HardwareOpusMultiStreamDecoder::DecodeInterleaved(unsigned long*, int*, short*, unsigned long, void const*, unsigned long) SDK >= 3.0.0, < 5.0.0 source

_ZN2nn5codec30HardwareOpusMultiStreamDecoder17DecodeInterleavedEPmPiPsmPKvm
As C: u32 (addr self, addr consumed, addr samples, addr out, usize out_size, addr in, usize in_size)
Handler: nncodec_hwopus_class_multi_decode (codec.c)

nn::codec::HardwareOpusMultiStreamDecoder::Finalize() SDK >= 3.0.0, < 5.0.0 source

_ZN2nn5codec30HardwareOpusMultiStreamDecoder8FinalizeEv
As C: void (addr self)
Handler: nncodec_hwopus_class_multi_finalize (codec.c)

nn::codec::HardwareOpusMultiStreamDecoder::GetWorkBufferSize(int, int, int, int) const SDK >= 3.0.0, < 12.0.0 SDK >= 6.0.0, < 11.0.0 32-bit source

_ZNK2nn5codec30HardwareOpusMultiStreamDecoder17GetWorkBufferSizeEiiii
As C: usize (addr self, i32 rate, i32 channels, i32 streams, i32 stereo_streams)
Handler: nncodec_hwopus_class_multi_work_size (codec.c)

Page 1 2 3


Made from ScarletNX's Sail at 166ad3910f80. The hooks' and the SVCs' declarations and their handlers are ScarletNX's (GPL-3.0-or-later); the SVCs' declarations are Eden's, as hos.svc says.