RGA in luckfox pico ultra w
Posted: 2025-05-20 10:12
176 rga_buffer_t src;
178 memset(&src, 0, sizeof(rga_buffer_t));
179
180 // Source is NV12 (YUV420SP)
181 src.vir_addr = vi_data;
182 src.phy_addr = NULL; // Not using physical address
183 src.fd = -1; // No dma_buf
184 src.width = width;
185 src.height = height;
186 src.wstride = width;
187 src.hstride = height;
188 src.format = RK_FORMAT_YCbCr_420_SP;
189 src.color_space_mode = 0; // Default color space
190 src.global_alpha = 0xFF;
191 src.rd_mode = 0;
192
193 // Destination is BGR888
194 rga_buffer_t dst;
195 memset(&dst, 0, sizeof(rga_buffer_t));
196
197 dst.vir_addr = bgr.data;
198 dst.phy_addr = NULL;
199 dst.fd = -1;
200 dst.width = width;
201 dst.height = height;
202 dst.wstride = width;
203 dst.hstride = height;
204 dst.format = RK_FORMAT_BGR_888;
205 dst.color_space_mode = 0;
206 dst.global_alpha = 0xFF;
207 dst.rd_mode = 0;
208
209 //color conversion
210 int ret = imcvtcolor(src, dst, src.format, dst.format);
211 if (ret != IM_STATUS_SUCCESS) {
212 printf("RGA imcvtcolor failed: %d\n", ret);
213 }
why this code is not working?
what i'm missing?
Can anyone please help with this issue.
178 memset(&src, 0, sizeof(rga_buffer_t));
179
180 // Source is NV12 (YUV420SP)
181 src.vir_addr = vi_data;
182 src.phy_addr = NULL; // Not using physical address
183 src.fd = -1; // No dma_buf
184 src.width = width;
185 src.height = height;
186 src.wstride = width;
187 src.hstride = height;
188 src.format = RK_FORMAT_YCbCr_420_SP;
189 src.color_space_mode = 0; // Default color space
190 src.global_alpha = 0xFF;
191 src.rd_mode = 0;
192
193 // Destination is BGR888
194 rga_buffer_t dst;
195 memset(&dst, 0, sizeof(rga_buffer_t));
196
197 dst.vir_addr = bgr.data;
198 dst.phy_addr = NULL;
199 dst.fd = -1;
200 dst.width = width;
201 dst.height = height;
202 dst.wstride = width;
203 dst.hstride = height;
204 dst.format = RK_FORMAT_BGR_888;
205 dst.color_space_mode = 0;
206 dst.global_alpha = 0xFF;
207 dst.rd_mode = 0;
208
209 //color conversion
210 int ret = imcvtcolor(src, dst, src.format, dst.format);
211 if (ret != IM_STATUS_SUCCESS) {
212 printf("RGA imcvtcolor failed: %d\n", ret);
213 }
why this code is not working?
what i'm missing?
Can anyone please help with this issue.