static void rgb24_to_gray(AVPicture *dst, AVPicture *src, int width, int height) { const unsigned char *p; unsigned char *q; int r, g, b, dst_wrap, src_wrap; int x, y;  p = src->data[0]; src_wrap = src->linesize[0] - 3 * width;  q = dst->data[0]; dst_wrap = dst->linesize[0] - width;  for(y=0;y<height;y++) { for(x=0;x<width;x++) { r = p[0]; g = p[1]; b = p[2];  q[0] = (FIX(0.29900) * r + FIX(0.58700) * g + FIX(0.11400) * b + ONE_HALF) >> SCALEBITS; q++; p += 3; } p += src_wrap; q += dst_wrap; } }
RGB_FUNCTIONS(rgb24)
static void rgb24_to_gray(AVPicture *dst, AVPicture *src,                          int width, int height){    const unsigned char *p;    unsigned char *q;    int r, g, b, dst_wrap, src_wrap;    int x, y;    p = src->data[0];    src_wrap = src->linesize[0] - 3 * width;    q = dst->data[0];    dst_wrap = dst->linesize[0] - width;    for(y=0;y<height;y++) {        for(x=0;x<width;x++) {            r = p[0];            g = p[1];            b = p[2];            q[0] = (FIX(0.29900) * r + FIX(0.58700) * g +                     FIX(0.11400) * b + ONE_HALF) >> SCALEBITS;            q++;            p += 3;        }        p += src_wrap;        q += dst_wrap;    }}