<div dir="ltr">Hi All,<br><br><div class="gmail_quote"><div dir="ltr"><div>Scaling_video.c example file modified to convert 1080p_YUV420 file to 240pYUV420. After conversion Luma content is fine, but chroma(color) contents are mismatching with original file.<br></div><div>I attached modified code, please direct me to get correct chroma contents also.<br> long int resol = (src_w * src_h *3)>>1;<br> int noframes = opusFileSize/resol;<br> printf("No of frames%d\n", noframes);<br> //<br> unsigned char* pYUV = NULL;<br> pYUV = (unsigned char *) malloc( resol);<br> if (pYUV == NULL)<br> exit(0);<br><br> src_data[0] = pYUV;<br> src_data[1] = pYUV + (src_w *src_h);<br> src_data[2] = pYUV + (resol>>2);<br> src_linesize[0]= src_w;<br> src_linesize[1]= src_linesize[2]= src_w >>1;<br> for (i = 0; i < noframes; i++) {<br> /* generate synthetic video */<br> //fill_yuv_image(src_data, src_linesize, src_w, src_h, i);<br> memset( pYUV, 0, resol );<br> fread(pYUV, 1, resol, fp);<br> /* convert to destination format */<br> sws_scale(sws_ctx, (const uint8_t * const*)src_data,<br> <wbr> src_linesize, 0, src_h, dst_data, dst_linesize);<br> /* write scaled image to file */<br> fwrite(dst_data[0], 1, dst_bufsize, dst_file);<br> }<span class="m_-2620228148022751809HOEnZb"><font color="#888888"><br><br></font></span></div><span class="m_-2620228148022751809HOEnZb"><font color="#888888"></font></span></div></div><div class="m_-2620228148022751809gmail_signature" data-smartmail="gmail_signature">Thanks & Regards<br>Vittal Prasad B R<br><br><br><br><br></div>
</div>