I have a JPEG image (say of size 10*10) and i want to perform a color conversion of some part of this JPEG image.
For example I want to perform color conversion for the image width starting from column "1 to 10".
In this case after conversion the color is not the same as in original image rather it is destorted.
Though by default the .c implementation of color conversion of jpeg image is done per pixel wise so there is no issue in performing color conversion from 1-10 (instead of 0-10),
But when I take the assembly implementation of color conversion (it performs on 8 pixel at a time) and perform the same task the image get distorted... (maxm part of image looks green)
Assembly code of color conversion is as below:
add Y, Y, START_X
add U, U, START_X
add V, V, START_X
only the above code is my addition
asm_function jsimd_ycc_\colorid\()_convert_neon
/* Outer loop over scanlines */
cmp NUM_ROWS, #1
blt 9f
0:
ldr Y, [INPUT_BUF0, INPUT_ROW, lsl #2]
ldr U, [INPUT_BUF1, INPUT_ROW, lsl #2]
mov N, OUTPUT_WIDTH
ldr V, [INPUT_BUF2, INPUT_ROW, lsl #2]
add Y, Y, START_X
add U, U, START_X
add V, V, START_X
add INPUT_ROW, INPUT_ROW, #1
ldr RGB, [OUTPUT_BUF], #4
/* Inner loop over pixels */
subs N, N, #8
blt 3f
do_load 8
do_yuv_to_rgb_stage1
subs N, N, #8
blt 2f
1:
do_yuv_to_rgb_stage2_store_load_stage1
subs N, N, #8
bge 1b
2:
do_yuv_to_rgb_stage2
do_store \bpp, 8
tst N, #7
beq 8f
3:
tst N, #4
beq 3f
do_load 4
3:
tst N, #2
beq 4f
do_load 2
4:
tst N, #1
beq 5f
do_load 1
.endfunc