packed rgb cropping patch
Hi all, I made small change to libavcodec/imgconvert.c to support cropping of packed RGB images. I need a pointer to how to make a patch or such is this is accepted. Does this seem correct? It worked when clipping some flashsv videos. int av_picture_crop(AVPicture *dst, const AVPicture *src, int pix_fmt, int top_band, int left_band) { if (pix_fmt < 0 || pix_fmt >= PIX_FMT_NB) return -1; if (!is_yuv_planar(&pix_fmt_info[pix_fmt])) { if (pix_fmt_info[pix_fmt].depth != 8) { av_log(NULL, AV_LOG_ERROR, "Only 8bits/channel packed formats supported.\n"); return -1; } dst->data[0] = src->data[0]+src->linesize[0]*top_band+(left_band*pix_fmt_info[pix_\ fmt].nb_channels); dst->linesize[0] = src->linesize[0]; } else { int y_shift; int x_shift; y_shift = pix_fmt_info[pix_fmt].y_chroma_shift; x_shift = pix_fmt_info[pix_fmt].x_chroma_shift; dst->data[0] = src->data[0] + (top_band * src->linesize[0]) + left_band; dst->data[1] = src->data[1] + ((top_band >> y_shift) * src->linesize[1]) + (left_b\ and >> x_shift); dst->data[2] = src->data[2] + ((top_band >> y_shift) * src->linesize[2]) + (left_b\ and >> x_shift); dst->linesize[0] = src->linesize[0]; dst->linesize[1] = src->linesize[1]; dst->linesize[2] = src->linesize[2]; } return 0; } - Teemu Keinonen
Hi Teemu Keinonen wrote:
Hi all,
I made small change to libavcodec/imgconvert.c to support cropping of packed RGB images. I need a pointer to how to make a patch or such is this is accepted.
First of all, install a SVN client if you don't have one already (google for it) and fetch the latest FFmpeg version from SVN (go to http://ffmpeg.mplayerhq.hu/download.html to see how). Then, make your changes and use the command (in the ffmpeg/ dir) svn diff > name.diff to make the patch. Don't forget to open name.diff in a text editor to check if you're changing anything you don't want to by accident. Finally, see http://ffmpeg.mplayerhq.hu/general.html#SEC25 . Sorry if it looks complicated, but it's simpler than it looks like... -Vitor
participants (2)
-
tkeinonen@gmail.com -
vitor1001@gmail.com