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.

[参考译文] TDA4VM:RGBX 至 YUV/UYVY

Guru**** 2644745 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1173921/tda4vm-rgbx-to-yuyv-uyvy

器件型号:TDA4VM

您好 TI:

    您能否提供用于图像转换(RGBX 至 YUV/UYVY)的接口?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    您可以为此使用 DSS M2M 节点。 请参阅以下常见问题解答。

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1007456/faq-tda4vm-how-to-use-dss-m2m-for-format-conversion

    此致、

    Brijesh

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

       我试过它。RGBX 到 YUV 不能正常工作。

    RGBX 至 NV12 工作正常。

    {
    
    obj->output_display_image_nv12 = vxCreateImage (obj->context、obj->outWidth、obj->outHeight、vx_df_image_NV12);
    status = vxGetStatus ((vx_reference) obj->output_display_image_nv12);
    obj->outoutdisplay_image_image_rg_divex、vgovx = vxgovx、outheight;obj_outv24=vxv_outv_context->outv_rev;obj_outheight;obj_outv24_outv_outv_outv
    status = vxGetStatus (((vx_reference) obj->output_display_image_rgb24);
    obj->output_display_image_yuyv = vxCreateImage (obj->context、obj->outWidth、obj->outHeight、vx_DF_image_UYVY);
    status = vxGetStatus (((vx_reference) obj->output_display_image_rgb24);
    
    
    rgbx_TO_yuv (obj、obj->output_image[0]、obj->output_display_image_yuv);
    rgbx_to _puyv (obj->output_image_wx_params->bx
    
    
    
    
    
    
    
    
    
    
    
    local_m2m_config.instId
    );仅支持 v2mw_out_display_ybx_params_div_ybx (vx)= v2mw_parature_w_parature_on_w_w_w_w_params = nv2mw_parature_out_display_w_w_params;rg_parnvx = w_parature_w_w_parature_parature_w_w_w_w_params_dive2mw_params*= v2mw_params_dive&nvx = nvx = v2mw_parature_params
    
    
    
    
    sizeof (tivx_display_m2m_params_t)、&obj->local_m2M_config);
    status = vxGetStatus (((vx_reference) obj->M2M_config);
    }
    
    ​if (status = vx_Success)
    ​{
    ​printf ("[hw]-obj->m2mnode!\n">m2mode-}
    ​、mobj_output = m2mode->mexit_image->moutput_mgraph、mm->mm_map_graph)
    ​
    ​if (status == vx_Success)
    ​{
    ​printf ("[hw]-vxSetNodeTarget!\n");
    ​vxSetNodeTarget (obj->m2mnode、vx_target_string、TIVX_TARGET_DISPLAY_M2M1);
    ​}
    ​
    ​返回状态;
    }
    
    vx_int32 write_output_image_fp (file * fp、vx_image out_image)
    {
    Vx_UINT32宽度、高度;
    vx_df_image df;
    vx_imagepatch_addressing_t image_addr;
    vx_arbet_t rect;
    vx_map_id map_id1、map_id2;
    void * data_ptr1、* data_ptr2;
    Vx_UINT32 num_Bytes_per_4像素;
    vx_UINT32 num_luma_bytes_written 到文件= 0;
    vx_UINT32 num_chroma_bytes_written 至_file=0;
    vx_uint32 num_Bytes_written 至_file=0;
    vx_uint32 imgaddr_width、imgaddr_height、imgaddr_STRIDE;
    int i;
    
    ​vxQueryImage (out_image、vx_image_width、width、sizeof (vx_UINT32));
    ​vxQueryImage (out_image、vx_image_height、height、sizeof (vx_UINT32));
    ​vxQueryImage (out_image、vx_image_format、&df、sizeof (vx_df_image));
    
    
    ​if (vx_df_image_NV12 == df)
    ​{
    ​num_Bytes_per_4像素= 4;
    ​}
    ​否则、如果(vx_df_image_RGBX == df)
    ​{
    ​num_Bytes_per_4像素= 16;
    ​}
    ​其他
    ​{
    ​num_Bytes_per_4像素= 8;
    ​}
    
    ​rect.start_x = 0;
    ​rect.start_y = 0;
    ​rect.end_x =宽度;
    ​rect.end_y =高度;
    
    ​vxMapImagePatch (out_image、
    ​矩形(&R)、
    ​0、
    ​&MAP_ID1、
    ​ℑ Ω addr、
    ​&DATA_Ptr1、
    ​Vx_write_only、
    ​Vx_memory_type_host、
    ​Vx_NOGAP_X
    ​);
    
    ​if (!data_ptr1)
    ​{
    ​printf ("data_ptr1为 NULL \n");
    ​返回-1;
    ​}
    
    ​imgaddr_width = image_addr.dim_x;
    ​imgaddr_height = image_addr.dim_y;
    ​imgaddr_STRIDE = image_addr.stade_y;
    ​printf ("imgaddr_width =%d \n"、imgaddr_width);
    ​printf ("imgaddr_height =%d \n"、imgaddr_height);
    ​printf ("imgaddr_STRIDE =%d \n"、imgaddr_STRIDE);
    ​printf ("width =%d \n"、width);
    ​printf ("高度=%d \n"、高度);
    
    ​num_luma_bytes_written 到文件= 0;
    
    ​for (i=0;i "data_ptr2="" is="" null="" \n");="" return="" -1;="" imgaddr_width="image_addr.dim_x;" imgaddr_height="image_addr.dim_y;" imgaddr_stride="image_addr.stride_y;" num_chroma_bytes_written_to_file="0;" for(i="0;i" imgaddr_width*num_bytes_per_4pixels="" data_ptr2="" map_id2);="" num_bytes_written_to_file="num_luma_bytes_written_to_file" num_chroma_bytes_written_to_file;="" printf("written="" %d="" bytes="" \n",="" num_bytes_written_to_file);="" num_bytes_written_to_file;="" vx_int32="" write_output_image_yuv422_8bit(char="" *="" file_name,="" vx_image="" out_yuv)="" file="" fp="fopen(file_name," "wb");="" if(!fp)="" app_printf("unable="" to="" open="" %s\n",="" file_name);="" vx_uint32="" len1="write_output_image_fp(fp," out_yuv);="" fclose(fp);="" app_printf("%d="" written="" len1,="" len1;="" int="" save_debug_images(appobj="" *obj)="" char="" yuv_image_fname[256];="" rgb_image_fname[256];="" nv12_image_fname[256];="" num_bytes_io;="" snprintf(yuv_image_fname,="" 256,="" "="" %s="" hhw_%s_%04d.yuv",="" "opt","vision_apps",="" "cap",="" file_index);="" snprintf(rgb_image_fname,="" hhw_%s_%04d.rgb",="" "rgb",="" snprintf(nv12_image_fname,="" "nv12",="" printf("yuv="" name="" yuv_image_fname);="" printf("rgb="" rgb_image_fname);="" printf("nv12="" nv12_image_fname);="" num_bytes_io="write_output_image_yuv422_8bit(rgb_image_fname," obj-="">output_image[0]);
    ​if (num_Bytes_io < 0)
    ​{
    ​printf ("写入 RGB 文件时出错\n");
    ​返回 Vx_FAILURE;
    ​}
    ​num_Bytes_io = write_output_image_yUV422_8bit (yuV_image_fname、obj-> output_display_image_yuv);
    ​if (num_Bytes_io < 0)
    ​{
    ​printf ("写入 YUV 文件时出错\n");
    ​返回 Vx_FAILURE;
    ​}
    ​num_Bytes_IO = WRITE_OUTPUT 映像 YUV422_8BIT (nv12_IMAGE_FNAME、obj-> OUTPW_DISPLAY_IMAGE_nv12);
    ​if (num_Bytes_io < 0)
    ​{
    ​printf ("写入 NV12文件时出错\n");
    ​返回 Vx_FAILURE;
    ​}
    ​File_index++;
    ​返回(file_index-1);
    }
    
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    RGBX