1 PVR350 Video decoder registers 0x02002800 -> 0x02002B00
2 =======================================================
4 This list has been worked out through trial and error. There will be mistakes
5 and omissions. Some registers have no obvious effect so it's hard to say what
6 they do, while others interact with each other, or require a certain load
7 sequence. Horizontal filter setup is one example, with six registers working
8 in unison and requiring a certain load sequence to correctly configure. The
9 indexed colour palette is much easier to set at just two registers, but again
10 it requires a certain load sequence.
12 Some registers are fussy about what they are set to. Load in a bad value & the
13 decoder will fail. A firmware reload will often recover, but sometimes a reset
14 is required. For registers containing size information, setting them to 0 is
15 generally a bad idea. For other control registers i.e. 2878, you'll only find
16 out what values are bad when it hangs.
18 --------------------------------------------------------------------------------
24 --------------------------------------------------------------------------------
27 Decoder horizontal Y alias register 1
31 Decoder horizontal Y alias register 2
35 Decoder horizontal Y alias register 3
39 Decoder horizontal Y alias register 4
43 Decoder horizontal Y alias register 5
47 Decoder horizontal Y alias trigger
49 These six registers control the horizontal aliasing filter for the Y plane.
50 The first five registers must all be loaded before accessing the trigger
51 (2818), as this register actually clocks the data through for the first
54 To correctly program set the filter, this whole procedure must be done 16
55 times. The actual register contents are copied from a lookup-table in the
56 firmware which contains 4 different filter settings.
58 --------------------------------------------------------------------------------
61 Decoder horizontal UV alias register 1
65 Decoder horizontal UV alias register 2
69 Decoder horizontal UV alias register 3
73 Decoder horizontal UV alias register 4
77 Decoder horizontal UV alias register 5
81 Decoder horizontal UV alias trigger
83 These six registers control the horizontal aliasing for the UV plane.
84 Operation is the same as the Y filter, with 2830 being the trigger
87 --------------------------------------------------------------------------------
90 Decoder Y source width in pixels
93 Decoder Y destination width in pixels
97 Decoder UV source width in pixels
100 Decoder UV destination width in pixels
102 NOTE: For both registers, the resulting image must be fully visible on
103 screen. If the image exceeds the right edge both the source and destination
104 size must be adjusted to reflect the visible portion. For the source width,
105 you must take into account the scaling when calculating the new value.
106 --------------------------------------------------------------------------------
110 Decoder Y horizontal scaling
111 Normally = Reg 2854 >> 2
115 Decoder ?? unknown - horizontal scaling
120 Decoder UV horizontal scaling
121 Normally = Reg 2854 >> 2
125 Decoder ?? unknown - horizontal scaling
130 Decoder ?? unknown - Y plane
135 Decoder ?? unknown - UV plane
140 Decoder 'master' value for horizontal scaling
150 Normally = Reg 2854 >> 1
160 Normally = Reg 2854 >> 1
167 Most of these registers either control horizontal scaling, or appear linked
168 to it in some way. Register 2854 contains the 'master' value & the other
169 registers can be calculated from that one. You must also remember to
170 correctly set the divider in Reg 2874.
173 Reg 2854 = (source_width * 0x00200000) / destination_width
176 To reduce from full size down to half size:
177 Reg 2854 = (source_width/2 * 0x00200000) / destination width
178 Reg 2874 = Divide by 2
180 To reduce from half size down to quarter size:
181 Reg 2854 = (source_width/4 * 0x00200000) / destination width
182 Reg 2874 = Divide by 4
184 The result is always rounded up.
186 --------------------------------------------------------------------------------
189 Decoder horizontal Y buffer offset
192 Decoder horizontal UV buffer offset
194 Offset into the video image buffer. If the offset is gradually incremented,
195 the on screen image will move left & wrap around higher up on the right.
197 --------------------------------------------------------------------------------
200 Decoder horizontal Y output offset
203 Decoder horizontal UV output offset
205 Offsets the actual video output. Controls output alignment of the Y & UV
206 planes. The higher the value, the greater the shift to the left. Use
207 reg 2890 to move the image right.
209 --------------------------------------------------------------------------------
212 Decoder horizontal Y output size divider
218 Decoder horizontal UV output size divider
226 1 = Affects video output levels
231 1 = Disable horizontal filter
233 --------------------------------------------------------------------------------
244 Decoder + osd video timing
253 Swaps upper & lower fields
255 --------------------------------------------------------------------------------
258 Decoder & osd ?? unknown
259 Moves entire screen horizontally. Starts at 0x005 with the screen
260 shifted heavily to the right. Incrementing in steps of 0x004 will
261 gradually shift the screen to the left.
266 Normally contents are 0x00101111 (NTSC) or 0x1010111d (PAL)
268 --------------------------------------------------------------------------------
269 2880 -------- ?? unknown
270 2884 -------- ?? unknown
271 --------------------------------------------------------------------------------
274 Decoder + osd ?? unknown
276 1 = Misaligned fields (Correctable through 289C & 28A4)
284 Warning: Bad values will require a firmware reload to recover.
285 Known to be bad are 0x000,0x011,0x100,0x111
286 --------------------------------------------------------------------------------
290 Appears to affect the osd position stability. The higher the value the
291 more unstable it becomes. Decoder output remains stable.
297 --------------------------------------------------------------------------------
300 Decoder output horizontal offset.
302 Horizontal offset moves the video image right. A small left shift is
303 possible, but it's better to use reg 2870 for that due to its greater
306 NOTE: Video corruption will occur if video window is shifted off the right
307 edge. To avoid this read the notes for 2834 & 2838.
308 --------------------------------------------------------------------------------
311 Decoder output video surround colour.
313 Contains the colour (in yuv) used to fill the screen when the video is
315 --------------------------------------------------------------------------------
318 Decoder video window colour
319 Contains the colour (in yuv) used to fill the video window when the
333 Decoder second plane byte order
337 In normal usage, the first plane is Y & the second plane is UV. Though the
338 order of the planes can be swapped, only the byte order of the second plane
339 can be swapped. This isn't much use for the Y plane, but can be useful for
342 --------------------------------------------------------------------------------
345 Decoder vertical field offset 1
348 Decoder vertical field offset 2
350 Controls field output vertical alignment. The higher the number, the lower
351 the image on screen. Known starting values are 0x011E0017 (NTSC) &
353 --------------------------------------------------------------------------------
356 Decoder & osd width in pixels
359 Decoder & osd height in pixels
361 All output from the decoder & osd are disabled beyond this area. Decoder
362 output will simply go black outside of this region. If the osd tries to
363 exceed this area it will become corrupt.
364 --------------------------------------------------------------------------------
369 Has a range of 0x770->0x7FF. With the exception of 0, any value outside of
370 this range corrupts the osd.
371 --------------------------------------------------------------------------------
374 osd vertical field offset 1
377 osd vertical field offset 2
379 Controls field output vertical alignment. The higher the number, the lower
380 the image on screen. Known starting values are 0x011E0017 (NTSC) &
382 --------------------------------------------------------------------------------
383 28AC -------- ?? unknown
386 28BC -------- ?? unknown
387 --------------------------------------------------------------------------------
396 The scanline counts from the top line of the first field
397 through to the last line of the second field.
398 --------------------------------------------------------------------------------
399 28C4 -------- ?? unknown
402 28F8 -------- ?? unknown
403 --------------------------------------------------------------------------------
408 1 = Breaks decoder & osd output
409 --------------------------------------------------------------------------------
412 Decoder vertical Y alias register 1
416 Decoder vertical Y alias register 2
420 Decoder vertical Y alias trigger
422 These three registers control the vertical aliasing filter for the Y plane.
423 Operation is similar to the horizontal Y filter (2804). The only real
424 difference is that there are only two registers to set before accessing
425 the trigger register (2908). As for the horizontal filter, the values are
426 taken from a lookup table in the firmware, and the procedure must be
427 repeated 16 times to fully program the filter.
428 --------------------------------------------------------------------------------
431 Decoder vertical UV alias register 1
435 Decoder vertical UV alias register 2
439 Decoder vertical UV alias trigger
441 These three registers control the vertical aliasing filter for the UV
442 plane. Operation is the same as the Y filter, with 2914 being the trigger.
443 --------------------------------------------------------------------------------
446 Decoder Y source height in pixels
449 Decoder Y destination height in pixels
453 Decoder UV source height in pixels divided by 2
456 Decoder UV destination height in pixels
458 NOTE: For both registers, the resulting image must be fully visible on
459 screen. If the image exceeds the bottom edge both the source and
460 destination size must be adjusted to reflect the visible portion. For the
461 source height, you must take into account the scaling when calculating the
463 --------------------------------------------------------------------------------
466 Decoder Y vertical scaling
467 Normally = Reg 2930 >> 2
471 Decoder Y vertical scaling
472 Normally = Reg 2920 + 0x514
476 Decoder UV vertical scaling
477 When enlarging = Reg 2930 >> 2
478 When reducing = Reg 2930 >> 3
482 Decoder UV vertical scaling
483 Normally = Reg 2928 + 0x514
487 Decoder 'master' value for vertical scaling
491 Decoder ?? unknown - Y vertical scaling
495 Decoder Y vertical scaling
500 Decoder ?? unknown - Y vertical scaling
504 Decoder UV vertical scaling
505 When enlarging = Reg 2930 >> 1
506 When reducing = Reg 2930
510 Decoder ?? unknown - UV vertical scaling
514 Decoder UV vertical scaling
519 Decoder ?? unknown - UV vertical scaling
521 Most of these registers either control vertical scaling, or appear linked
522 to it in some way. Register 2930 contains the 'master' value & all other
523 registers can be calculated from that one. You must also remember to
524 correctly set the divider in Reg 296C
527 Reg 2930 = (source_height * 0x00200000) / destination_height
530 To reduce from full size down to half size:
531 Reg 2930 = (source_height/2 * 0x00200000) / destination height
532 Reg 296C = Divide by 2
534 To reduce from half down to quarter.
535 Reg 2930 = (source_height/4 * 0x00200000) / destination height
536 Reg 296C = Divide by 4
538 --------------------------------------------------------------------------------
541 Decoder Y line index into display buffer, first field
544 Decoder Y vertical line skip, first field
545 --------------------------------------------------------------------------------
548 Decoder Y line index into display buffer, second field
551 Decoder Y vertical line skip, second field
552 --------------------------------------------------------------------------------
555 Decoder UV line index into display buffer, first field
558 Decoder UV vertical line skip, first field
559 --------------------------------------------------------------------------------
562 Decoder UV line index into display buffer, second field
565 Decoder UV vertical line skip, second field
566 --------------------------------------------------------------------------------
569 Decoder destination height minus 1
572 Decoder destination height divided by 2
573 --------------------------------------------------------------------------------
576 Decoder Y vertical offset, second field
579 Decoder Y vertical offset, first field
581 These two registers shift the Y plane up. The higher the number, the
583 --------------------------------------------------------------------------------
586 Decoder UV vertical offset, second field
589 Decoder UV vertical offset, first field
591 These two registers shift the UV plane up. The higher the number, the
593 --------------------------------------------------------------------------------
596 Decoder vertical Y output size divider
602 Decoder vertical UV output size divider
606 --------------------------------------------------------------------------------
611 1 = Affect video output levels
616 1 = Disable vertical filter
618 --------------------------------------------------------------------------------
619 2974 -------- ?? unknown
622 29EF -------- ?? unknown
623 --------------------------------------------------------------------------------
665 Must be 0x001B (some kind of buffer pointer ?)
667 When the bits-per-pixel is set to 8, the colour mode is ignored and
668 assumed to be 8 bit indexed. For 16 & 32 bits-per-pixel the colour depth
669 is honoured, and when using a colour depth that requires fewer bytes than
670 allocated the extra bytes are used as padding. So for a 32 bpp with 8 bit
671 index colour, there are 3 padding bytes per pixel. It's also possible to
672 select 16bpp with a 32 bit colour mode. This results in the pixel width
673 being doubled, but the color key will not work as expected in this mode.
675 Colour key is as it suggests. You designate a colour which will become
676 completely transparent. When using 565, 555 or 444 colour modes, the
677 colour key is always 16 bits wide. The colour to key on is set in Reg 2A18.
679 Local alpha works differently depending on the colour mode. For 32bpp & 8
680 bit indexed, local alpha is a per-pixel 256 step transparency, with 0 being
681 transparent and 255 being solid. For the 16bpp modes 555 & 444, the unused
682 bit(s) act as a simple transparency switch, with 0 being solid & 1 being
683 fully transparent. There is no local alpha support for 16bit 565.
685 Global alpha is a 256 step transparency that applies to the entire osd,
686 with 0 being transparent & 255 being solid.
688 It's possible to combine colour key, local alpha & global alpha.
689 --------------------------------------------------------------------------------
692 osd x coord for left edge
695 osd y coord for top edge
699 osd x coord for right edge
702 osd y coord for bottom edge
704 For both registers, (0,0) = top left corner of the display area. These
705 registers do not control the osd size, only where it's positioned & how
706 much is visible. The visible osd area cannot exceed the right edge of the
707 display, otherwise the osd will become corrupt. See reg 2A10 for
709 --------------------------------------------------------------------------------
714 An index into the osd buffer. Slowly incrementing this moves the osd left,
715 wrapping around onto the right edge
716 --------------------------------------------------------------------------------
719 osd buffer 32 bit word width
721 Contains the width of the osd measured in 32 bit words. This means that all
722 colour modes are restricted to a byte width which is divisible by 4.
723 --------------------------------------------------------------------------------
729 osd line index into buffer
730 osd will start displaying from this line.
731 --------------------------------------------------------------------------------
736 Contains the colour value which will be transparent.
737 --------------------------------------------------------------------------------
742 Contains the global alpha value (equiv ivtvfbctl --alpha XX)
743 --------------------------------------------------------------------------------
744 2A20 -------- ?? unknown
747 2A2C -------- ?? unknown
748 --------------------------------------------------------------------------------
751 osd colour to change in indexed palette
755 osd colour for indexed palette
757 To set the new palette, first load the index of the colour to change into
758 2A30, then load the new colour into 2A34. The full palette is 256 colours,
759 so the index range is 0x00-0xFF
760 --------------------------------------------------------------------------------
761 2A38 -------- ?? unknown
762 2A3C -------- ?? unknown
763 --------------------------------------------------------------------------------
768 Affects overall brightness, wrapping around to black
769 --------------------------------------------------------------------------------
775 --------------------------------------------------------------------------------
781 --------------------------------------------------------------------------------
786 Affects overall brightness, wrapping around to black
787 --------------------------------------------------------------------------------
793 --------------------------------------------------------------------------------
799 --------------------------------------------------------------------------------
800 2A58 -------- ?? unknown
803 2AFC -------- ?? unknown
804 --------------------------------------------------------------------------------
814 --------------------------------------------------------------------------------
816 v0.4 - 12 March 2007 - Ian Armstrong (ian@iarmst.demon.co.uk)