Forums - fcvColorRGB565ToRGB888u8 crashes

3 posts / 0 new
Last post
fcvColorRGB565ToRGB888u8 crashes
treter
Join Date: 30 Sep 14
Posts: 5
Posted: Sat, 2015-01-31 16:53

When I call fcvColorRGB565ToRGB888u8, I recieve an error like this:

No source available for "rgb565_to_rgb888C() at [hexadecimal address]"

Parameters and function call look like this:

jshort* src = env->GetShortArrayElements(img, &isCopy); //img is jshortArray - data of a bitmap passed from Java to JNI

uint8_t* dst= (uint8_t*) fcvMemAlloc(w * h, 16);

fcvColorRGB565ToRGB888u8((uint8_t*) src, srcWidth, srcHeight, 0, dst, 0);

Could it be problem with data types and conversion, or srcWidth and srcHeight parameters must be multiple of 8?

  • Up0
  • Down0
jeff4s Moderator
Join Date: 4 Nov 12
Posts: 106
Posted: Sun, 2015-02-01 23:59

It appears that your memory allocation for dst is not sufficient. It should be 3*w*h due to RGB888 format as each pixel occupies 3 bytes.

  • Up0
  • Down0
treter
Join Date: 30 Sep 14
Posts: 5
Posted: Tue, 2015-02-03 14:52

Thank you, this issue was very helpful! However, why is it so? When: RGB565 is 16bit format and RGB888 is 24bit, where is the 3* ?

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.