I am having trouble configuring the VPFE resizer. I need to use it to resize
frames from RAM to RAM. I can only get it to work at certain settings, none
of which comply with the equations from sprue38b. Yet, I would like to
compute the register settings based on some restricted user input.

The problem seems to be that the resizer will hang indefinitely if it is
enabled with IN_SIZE values other than what it expects. But, without the
exact equations for these values, I cannot reliably calculate the proper
settings.

To simplify things until I get the resizer working reliably, I tried to
enable the resizer with a 1x setting. According to sprue38b, resizing to 1x,
should use the 8-Phase, 4-tap mode and RSZ should be 256. Assuming spv=0,
sph=0 and Ex=0 the equations from sprue38b Table 21 simplify to:
iw=((ow-1)*256+16)>>8+7 
ih=((oh-1)*256+16)>>8+4.

So for example to get an output of 202x285 pixels, substitute ow=202 in the
equation for iw yielding:
iw=((202-1)256+16)>>8+7
iw=(51472)>>8 + 7
iw=201+7
iw=208

Similarly using oh=285 in the equation for ih yields:
ih=((285-1)256+16)>>8+4
ih=(72720)>>8+4
ih=284+4
ih=288

So, I have: 
Register            Value  
------------------- -----  
RSZ_CNT.HRSZ  (hrsz) 256   
RSZ_CNT.VRSZ  (vrsz) 256  
RSZ_CNT.HSTPH (sph)    0 
RSZ_CNT.VSTPH (spv)    0 
OUT_SIZE.HORZ (ow)   202   
OUT_SIZE.VERT (oh)   285   
IN_SIZE.HORZ  (iw)   208   
IN_SIZE.VERT  (ih)   288 
YENH.ALGO              0

But, this configuration hangs the resizer. I have attempted numerous other
settings with mixed results. Listed below are some of the configurations I
have tried with an indication if the resizer RAN or HUNG. Note that none of
the combinations resulting in a running resizer satisfy the ih equation
provided.

Register            Set 1 Set 2 Set 3 Set 4 Set 5 Set 6 Set 7 Set 8
------------------- ----- ----- ----- ----- ----- ----- ----- -----
RSZ_CNT.HRSZ  (hrsz) 256   256   256   256   147   147   256   256
RSZ_CNT.VRSZ  (vrsz) 256   256   256   256   147   147   256   256
RSZ_CNT.HSTPH (sph)    0     0     0     0     0     0     0     0
RSZ_CNT.VSTPH (spv)    0     0     0     0     0     0     0     0
OUT_SIZE.HORZ (ow)   202   202   202   202   352   352   192   192
OUT_SIZE.VERT (oh)   285   287   285   287   492   492   275   275
IN_SIZE.HORZ  (iw)   208   208   208   208   208   208   198   198
IN_SIZE.VERT  (ih)   288   291   289   290   287   286   279   278
YENH.ALGO              0     0     0     0     0     0     0     0
RESIZER STATUS      HUNG   RAN   RAN  HUNG   RAN  HUNG   RAN  HUNG
SATISFIES EQUATIONS  YES    NO    NO   YES    NO   YES    NO   YES

The exact lines of ‘C’ code I am using to compute iw and ih are listed
below. I would greatly appreciate it if someone could show me what is wrong.
The code exactly implements the equations provided (given the assumptions
noted above).

ih = (((oh - 1) * vrsz + 16) >> 8) + 4;
iw = (((ow - 1) * hrsz + 16) >> 8) + 7;

If anyone can point out my error I would greatly appreciate it.

Thanks,
Tony

_______________________________________________
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to