Ticket #965: vidix_nv12.diff

File vidix_nv12.diff, 2.0 KB (added by reimar, 18 years ago)

First steps to NV12 support

  • vidix/nvidia_vid.c

     
    789789        value = info->pitch;       
    790790            if(info->use_colorkey)value |= 1 << 20;
    791791        if(info->format == IMGFMT_YUY2)value |= 1 << 16;
     792        if(info->format == IMGFMT_NV12) {
     793            value |= 1 << 16 | 1;
     794            VID_WR32 (info->chip.PVIDEO, 0x820 + 0, info->height * info->pitch);
     795        }
    792796        VID_WR32 (info->chip.PVIDEO, 0x958 + 0, value);
    793797            //VID_WR32 (info->chip.PVIDEO, 0x958 + 4, (pitch << 1) | 0x00100000);
    794798
     
    984988
    985989inline static int is_supported_fourcc(uint32_t fourcc)
    986990{
    987         if      (fourcc == IMGFMT_UYVY || fourcc == IMGFMT_YUY2)
     991        if      (fourcc == IMGFMT_UYVY || fourcc == IMGFMT_YUY2 ||
     992                 (fourcc == IMGFMT_NV12 && info->chip.arch >= NV_ARCH_10))
    988993                return 1;
    989994        else
    990995                return 0;
     
    10361041                    info->pitch = ((info->width << 1) + (vinfo->dest.pitch.y-1)) & ~(vinfo->dest.pitch.y-1);
    10371042                    vinfo->frame_size = info->pitch * info->height;
    10381043                    break;
     1044            case IMGFMT_NV12:
     1045                    vinfo->dest.pitch.y = 64;
     1046                    vinfo->dest.pitch.u = 64;
     1047                    vinfo->dest.pitch.v = 64;
     1048                    vinfo->offset.y = 0;
     1049                    vinfo->offset.u = 0;
     1050                    vinfo->offset.v = 0;
     1051                    info->pitch = ((info->width << 1) + (vinfo->dest.pitch.y-1)) & ~(vinfo->dest.pitch.y-1);
     1052                    vinfo->frame_size = info->pitch * info->height * 2;
     1053                    break;
    10391054    }
    10401055    info->buffer_size = vinfo->frame_size;
    10411056    info->num_frames = vinfo->num_frames= (info->chip.fbsize - info->picture_offset)/vinfo->frame_size;
  • vidix/fourcc.h

     
    7878
    7979/*  Vendor-specific formats   */
    8080#define IMGFMT_WNVA    vid_fourcc('W','N','V','A') /* Winnov hw compress */
     81#define IMGFMT_NV12    vid_fourcc('N','V','1','2') /* nvidia NV12 */
    8182
    8283#endif