This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

dm6435 resizer - use of calccoef utility

I want to use the resizer on the fly to scale an incoming image for processing purposes, not for display.  This means I care about the input dimensions & resize ratios, but not at all about the output dimensions (I'll use whatever output dimensions are dictated by the selected resize ratio).  I have a few questions about setting this up:

1) When I use the calccoef utility to generate a set of filter constants for use by the resizer, I want to specify the input width & resize ratios.  It seems that I can only get the utility to spit out constants if I specify input & output dimensions.  I see the available -r option for doing this, and I have been trying various combinations like ./calccoef -i1280x256 -r512x256 but nothing seems to work.  I basically want to sweep a certain range of resize ratios like the gen_zoom example sweeps output size.  Is there a way to do this?

2) Are the generated filter constants a general case for a given resize ratio?  That is, if I generate a set of horizontal filter constants for a 96% downres, is that set of filter constants good for all valid input widths, as long as I follow the constraints?

3) Is a set of filter constants for a given resize ratio identical in the horizontal & vertical directions?

Thanks for any input

  • Theoretically, the filter is only dependent on the resize ratio.

     

    To use that program, you always have to specify the output size. So, you have to use it this way: "./calccoef -i 1280x256 -r 512x256 -o 640x256". If you look at the output, the program actually adjusts the input size.

     

  • This didn't quite work.  It would only adjust the input dimensions so far.  I ended up having to pick a convenient starting input/output width, and then adjusted the output width and the resizer ratio to get my constants.  Here is my script if anyone is interested (I swept resizer ratio from 128 to 511):

    #!/bin/bash
          width=256
        ratio=128
        echo "static const short resizer_coefs[384][32] = {";
            x='x'
            while [  $ratio -lt 512 ]; do
             ./calccoef -i512x-1 -o $width$x-1 -r $ratio$x-1 -a
               let ratio=ratio+1
             let width=width+2;
            done
        echo "};"