MVD Services

From 3dbrew
Jump to navigation Jump to search

This is for using the MVD hardware video decoder(unknown whether MVD can do more than decoding) + hardware color-format converter. The New_3DS Internet Browser uses mvd:STD for video decoding + YUV2RGB for decoded MJPEG frames.

See here for the supported hardware decoder video codecs.

There can only be one service session open at a time for each individual MVD service.

MVD Service "mvd:STD"

Command Header Available since system version Description
0x00010082 Initialize
0x00020000 Shutdown
0x00030300 CalculateWorkBufSize
0x000400C0 Unknown. Not used by SKATER.
0x00050100 (s8 unk0, s8 unk1, s8 unk2, u32 unk3) SKATER uses hard-coded value 0 for all of these params.
0x00060000 Unknown. Not used by SKATER.
0x00070000
0x00080142 ProcessNALUnit
0x00090042 ControlFrameRendering
0x000A0000 GetStatus
0x000B0000 GetStatusOther(unknown what this is used for). Same output size as GetStatus.
0x000C0100 (u8 unk0, s8 unk1, u32 unk2, u32 unk3) Unknown. Not used by SKATER.
0x000D0000 Unknown. Not used by SKATER.
0x000E0202 Unknown. Not used by SKATER. The code for this appears to be similar to ProcessNALUnit, this DMAs data from the input buffer as well.
0x000F0042 (s8 unk, val0, handle) Unknown. Not used by SKATER. Presumably the command 0x000E0202 version of MVDSTD:ControlFrameRendering.
0x00100400 Unknown. Not used by SKATER.
0x00110000 Unknown. Not used by SKATER.
0x001200C0 (s8 unk0, u32 unk1, u32 unk2) Unknown. Not used by SKATER.
0x00130000 Unknown. Not used by SKATER.
0x001400C2 Unknown. Not used by SKATER. The code for this appears to be similar to ProcessNALUnit, this DMAs data from the input buffer as well.
0x00150042 (s8 unk, val0, handle) Unknown. Not used by SKATER. Presumably the command 0x001400C2 version of MVDSTD:ControlFrameRendering.
0x00160000 Unknown. Not used by SKATER.
0x00170000 Unknown. Not used by SKATER.
0x00180000 Unknown. Used during initialization regardless of the operation mode(color-conversion/video-processing).
0x00190000 Unknown. Used during shutdown regardless of the operation mode(color-conversion/video-processing).
0x001A0000 Used when doing color-format conversion.
0x001B0040 (u8 unknown) SKATER uses value 1 for this.
0x001C0000
0x001D0042 GetConfig
0x001E0044 SetConfig
0x001F0902 Unknown. Not used by SKATER. This appears to write data to the specified output buffers via hardware?
0x00200002 (val0, handle) Unknown. Not used by SKATER. This loads data from the table entry which has a field matching an input parameter. This is the table used by command 0x001F0902.
0x00210100 (u32 unk0, u32 unk1, u32 unk2, u32 unk3) Unknown. Not used by SKATER. This initializes table data used by command 0x001F0902.

This one uses the I/O mapped @ 0x10207000.

This service is used by the New_3DS Internet Browser.

By default MVD does(?) various post-processing with the output image, this is controlled by the configuration. This post-processing isn't done at all in certain cases. By default MVD will align the output frame width to 512, by writing zero-value pixels.

Initialization procedures:

  • Color-conversion: Use command MVDSTD:Initialize with bufsize=1, then command 0x00180000.
  • H.264: If needed, use MVDSTD:CalculateWorkBufSize. Then use MVDSTD:Initialize. Then use commands 0x00050100, 0x00180000, and 0x001B0040. Then use MVDSTD:ProcessNALUnit for each of the individual NAL-unit parameter sets("Sequence Parameter Set" and "Picture Parameter Set"), with the main video processing starting afterwards.

Shutdown procedures:

  • Color-conversion: just use command 0x00190000, then MVDSTD:Shutdown.
  • H.264: Use command 0x00090042 in a loop, waiting for it to return a retval that isn't 0x00017002. Then use commands 0x001C0000, 0x00190000, and 0x00070000. Then use MVDSTD:Shutdown.

MVD Service "l2b:u"

This one uses the I/O mapped @ 0x10130000.

MVD Service "l2b2:u"

This uses the same command-handler as "l2b:u".

MVD Service "y2r2:u"

This one uses the I/O mapped @ 0x10102000.

MVD Result-codes

Result-code Internal MVD status-code Description
0xD961710F Invalid configuration, mainly when setting the config.
0x17000 OK
0x17002 Busy. When returned by command 0x00090042 during video processing, SKATER uses the {MVDSTD:GetConfig, MVDSTD:SetConfig, and 0x00090042} commands again(same config as before). The SKATER code for this includes this debug string: "H264 output %lld us corrected to %lld us\n".

Supported H.264 Levels and Profiles

Level Baseline Main High High 10 (High10, High10p, Hi10p or 10-bit H.264) High 4:2:2 (High422p or High422) High 4:4:4 Predictive (Hi444PP)
1 Yes Yes Yes Yes Untested Untested
1b Yes Yes Yes Yes Untested Untested
1.1 Yes Yes Yes Yes Untested Untested
1.2 Yes Yes Yes Yes Untested Untested
1.3 Yes Yes Yes Yes Untested Untested
2 Yes Yes Yes Yes Untested Untested
2.1 Yes Yes Yes Yes Untested Untested
2.2 Yes Yes Yes Yes Untested Untested
3 Yes Yes Yes Yes Untested Untested
3.1 Yes Yes Yes Yes Untested Untested
3.2 Yes Yes Yes Yes Untested Untested
4 No (untested) No (untested) No (untested) No (untested) No (untested) No (untested)
4.1 No (untested) No (untested) No (untested) No (untested) No (untested) No (untested)
4.2 No (untested) No (untested) No (untested) No (untested) No (untested) No (untested)
5 No (untested) No (untested) No (untested) No (untested) No (untested) No (untested)
5.1 No (untested) No (untested) No (untested) No (untested) No (untested) No (untested)
5.2 No (untested) No (untested) No (untested) No (untested) No (untested) No (untested)

created using the New 3DS Internet Browser, New 3DS Internet Browser Specs and the following test pages:
Baseline Profile Test
Main Profile Test
High Profile Test
High10 Profile Test