MVDSTD:CalculateWorkBufSize: Difference between revisions

2670QM (talk | contribs)
Added command detail.
2670QM (talk | contribs)
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 91: Line 91:
| FLAG_ENABLE_EXTRA_OP (see below)
| FLAG_ENABLE_EXTRA_OP (see below)
|-
|-
| 0x03
| 0x04
| FLAG_UNK
| FLAG_UNK
|}
|}
Line 153: Line 153:
|}
|}


This will calculate maximum possible buffer size (==buffer size that '''''may''''' be needed to decode video) based on H.264 level and resolution, so any videos that are compliant with H.264 specs should be decoded with this buffer size.
This will calculate maximum possible buffer size (==buffer size that '''''may''''' be needed to decode video) based on H.264 level and resolution, <s>so any videos that are compliant with H.264 specs should be decoded with this buffer size</s> '''''it seems there is some buffer overflow (some hundreds bytes according to test) when maximum number of reference frames are used''''', so adding some extra bytes (maybe around 4096Bytes is enough) is safer.


Calculation procedures are :
Calculation procedures are :
Line 194: Line 194:
If number of reference frames (offset 0x01) is less than 0x02, 0x02 is used internally, if it's greater than 0x10, 0x10 is used internally.
If number of reference frames (offset 0x01) is less than 0x02, 0x02 is used internally, if it's greater than 0x10, 0x10 is used internally.


----


It is possible to enable more than 1 calculation methods simultaneously, in that case the biggest buffer size among them is returned.
It is possible to enable more than 1 calculation methods simultaneously, in that case the largest buffer size among them is returned.


SKATER uses
SKATER uses
```
 
<nowiki>
cmd.CalculateWorkBufWithLevel.enable = 0x01;
cmd.CalculateWorkBufWithLevel.enable = 0x01;
cmd.CalculateWorkBufWithLevel.flag = 0x07; //(FLAG_ENABLE_CALCULATION | FLAG_ENABLE_EXTRA_OP | FLAG_UNK).
cmd.CalculateWorkBufWithLevel.flag = 0x07; //(FLAG_ENABLE_CALCULATION | FLAG_ENABLE_EXTRA_OP | FLAG_UNK).
Line 209: Line 211:
cmd.width = 854; //Regardless of input video, 854 is always used.
cmd.width = 854; //Regardless of input video, 854 is always used.
cmd.height = 480; //Regardless of input video, 480 is always used.
cmd.height = 480; //Regardless of input video, 480 is always used.
```
</nowiki>
and result is 9438920Bytes (0x9006C8), aka MVD_DEFAULT_WORKBUF_SIZE.
 
and result is '''9438920Bytes''' (0x9006C8), aka MVD_DEFAULT_WORKBUF_SIZE.


This doesn't write to MVD state / registers at all.
This doesn't write to MVD state / registers at all.