1
The work has been based on the RV30 codec, but since RV20 has the same
2
interface, it might work for it as well.
7
error codes (the software uses redmond originated error codes)
9
1. internal code (1-10)
14
2 8007000E E_OUTOFMEMORY
15
3,9 80004001 E_NOTIMPL
16
4,5 80070005 E_ACCESSDENIED
18
7,10 80070057 E_INVALIDREG
19
8 80040FC1 (or 1FC?: CO_E_OBJISREG) - never occurred here
25
I think the only relevant file is the decoder drv[23].so.6.0
26
The rv[23]0 ones are just for streaming. We do this ourselves.
29
The codec consists of several functions. The relevant ones are:
32
RV20toYUV420Transform()
33
RV20toYUV420CustomMessage()
37
The others are irrelevant (seems to me). HiveMessage doesn't manipulate
38
anything and is only called in the beginning.
40
result=RV20toYUV420Init(struct init_data *, struct rvyuvMain **);
51
format1 and format2 are stored in the .rm file's stream headers.
52
(format1>>16)&3 seems to be a sub-codec id/selector, at least for rv30
53
it's the only difference between low and high bitrate files.
55
result=RV20toYUV420Transform(char *input_stream, char *output_data,
56
struct transin *, struct transout *, struct rvyuvMain *);
59
ulong length_of_input_data;
61
ulong num_sub_packets_in_block_minus_one;
62
ulong *sub_packets_list;
64
ulong timestamp_from_stream;
68
ulong flag1; // ((var_94&2!=0)&&(result==0))?1:0
69
ulong flag2; // 4 LBS from var_94
74
The length of output_stream is 1.5*width*height (I420 planar yuv 4:2:0).
75
input_stream is the exact data from the data block for one frame.
77
sub_packets_list is a list of num_sub_packets pairs of long values, in form:
84
where offset_* are the offsets or sub-packets relative to input_stream.
87
result=RV20toYUV420CustomMessage(ulong *msg, struct rvyuvMain *);
89
Messages used by RV30:
91
A message is a triplet (cmd,val,ext) of ulong.
94
rv30 only requires the (0x24,2|3,{w,h,w,h}) message. others can be left out!
95
rv20 only requires the (0x11,2,0) message in rp8, before each transform call.
98
returns always(?) an error, since a global variable inside the codec
99
(which points to a function similar to custommessage), is always NULL
102
val=0|1: sets intern2 to val, when intern1 is non-zero
103
return 3 when intern1 is zero and val is 1
105
val=2: return intern2
106
what does intern[1,2] mean?
109
used by rv20, function unknown, can be ignored
112
calls a subroutine and returns the result, purpose has to be detemined
114
(0x24,subcodec,{...})
115
copies 4 dwords to rvyuvMain+07c: { width, height, 0, 0 }
116
subcodec must be 2 (low-bitrate) or 3 (high-bitrate) for rv30.
117
the codec type (low vs high) can be determined from 1+((format1>>16)&3)
118
for rv20, this call should be ignored! (makes codec crashing)
120
(0x1c,a,b) - called inside transform
124
used by rv20, function unknown, can be ignored
127
structure of rvyuvMain:
128
-----------------------
130
DWORDS (the entries are not always constant)
131
there are two w/h pairs at 05C. the first is the size of the
132
unscaled video stream, the second possibly image size
135
010 1 0 AEBFC0D1(magic) 0
137
030 0 0 ->rvyuvMain+0x050 ?
138
040 width height 0x17 0x479
139
050 ->rvyuvMain 0x17 0x17 width
140
060 height width height 0
144
0A0 1 0xb0(w?) 0x58 0x58
151
110 p p p p p are pointers to several function, for
152
120 p p p p example to the actual public functions
153
130 p p p p (except init, the others are some kind of
154
140 p p p p interfaces)
161
1B0 1 0 ptr->? ptr->?
181
Transform (internally calls (0x1c,x,y))