Image Resize On Block Level

I want to resize an image on block level (MCU by MCU). Actually i have the decoded YUV image, that i want to resize. But i dont want to pick up the whole image due to memory requirement, but want to pick a block and then resize, rotate and trim it. Please let me know if anyone of you have any idea about the same. I have tried it with the interpolation, but i dont think so it will be successful on the Block level.

Waiting for replies,
Anshuman Goyal
[email protected]

Comments

  • : I want to resize an image on block level (MCU by MCU). Actually i
    : have the decoded YUV image, that i want to resize. But i dont want
    : to pick up the whole image due to memory requirement, but want to
    : pick a block and then resize, rotate and trim it. Please let me know
    : if anyone of you have any idea about the same. I have tried it with
    : the interpolation, but i dont think so it will be successful on the
    : Block level.

    I think interpolation will work fine, but maybe a little (or a lot) slow...

    Some psuedo:
    [code]
    array scale(xscale, yscale){
    for all x in new image (old y * xscale)
    for all y in new image (old y * xscale)
    array[x][y]=getInterpolation(x*xscale.y*yscale)

    return array;
    }
    var getInterpolation(x,y){
    return interpolate(
    getVar(floor x,floor y),
    getVar(floor x,ceil y),
    getVar(ceil x,floor y),
    getVar(ceil x,ceil y),
    x mod 1, y mod 1
    );
    }
    var getVar(){
    block = blocks[x/blocksize,y/blocksize];
    return block[x mod blocksize, y mod blocksize];
    }

    var interpolate(var tl, var tr, var bl, var br,x,y){
    //your own interpolate func
    //here's a sample
    return (tl*x)+(tr*(1-x))*y + (bl*x)+(br*(1-x))*(1-y);
    }
    [/code]

    All this is written from head...
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion