comparison vidix/drivers/radeon_vid.c @ 4415:30d17394db39

Use one pitch source
author nick
date Wed, 30 Jan 2002 09:39:58 +0000
parents 7442f588cf48
children 06752d1ad228
comparison
equal deleted inserted replaced
4414:7442f588cf48 4415:30d17394db39
879 } 879 }
880 880
881 static int radeon_vid_init_video( vidix_playback_t *config ) 881 static int radeon_vid_init_video( vidix_playback_t *config )
882 { 882 {
883 uint32_t tmp,src_w,src_h,dest_w,dest_h,pitch,h_inc,step_by,left,leftUV,top; 883 uint32_t tmp,src_w,src_h,dest_w,dest_h,pitch,h_inc,step_by,left,leftUV,top;
884 int is_420; 884 int is_420,best_pitch,mpitch;
885 radeon_vid_stop_video(); 885 radeon_vid_stop_video();
886 left = config->src.x << 16; 886 left = config->src.x << 16;
887 top = config->src.y << 16; 887 top = config->src.y << 16;
888 src_h = config->src.h; 888 src_h = config->src.h;
889 src_w = config->src.w; 889 src_w = config->src.w;
890 is_420 = 0; 890 is_420 = 0;
891 if(config->fourcc == IMGFMT_YV12 || 891 if(config->fourcc == IMGFMT_YV12 ||
892 config->fourcc == IMGFMT_I420 || 892 config->fourcc == IMGFMT_I420 ||
893 config->fourcc == IMGFMT_IYUV) is_420 = 1; 893 config->fourcc == IMGFMT_IYUV) is_420 = 1;
894 best_pitch = radeon_query_pitch(config->fourcc);
895 mpitch = best_pitch-1;
894 switch(config->fourcc) 896 switch(config->fourcc)
895 { 897 {
896 /* 4:2:0 */ 898 /* 4:2:0 */
897 case IMGFMT_IYUV: 899 case IMGFMT_IYUV:
898 case IMGFMT_YV12: 900 case IMGFMT_YV12:
899 case IMGFMT_I420: pitch = (src_w + 31) & ~31; 901 case IMGFMT_I420: pitch = (src_w + mpitch) & ~mpitch;
900 config->dest.pitch.y = 902 config->dest.pitch.y =
901 config->dest.pitch.u = 903 config->dest.pitch.u =
902 config->dest.pitch.v = 32; 904 config->dest.pitch.v = best_pitch;
903 break; 905 break;
904 /* 4:2:2 */ 906 /* 4:2:2 */
905 default: 907 default:
906 case IMGFMT_UYVY: 908 case IMGFMT_UYVY:
907 case IMGFMT_YUY2: 909 case IMGFMT_YUY2:
908 pitch = ((src_w*2) + 15) & ~15; 910 pitch = ((src_w*2) + mpitch) & ~mpitch;
909 config->dest.pitch.y = 911 config->dest.pitch.y =
910 config->dest.pitch.u = 912 config->dest.pitch.u =
911 config->dest.pitch.v = 16; 913 config->dest.pitch.v = best_pitch;
912 break; 914 break;
913 } 915 }
914 dest_w = config->dest.w; 916 dest_w = config->dest.w;
915 dest_h = config->dest.h; 917 dest_h = config->dest.h;
916 if(radeon_is_dbl_scan()) dest_h *= 2; 918 if(radeon_is_dbl_scan()) dest_h *= 2;
963 besr.vid_buf0_base_adrs = radeon_overlay_off; 965 besr.vid_buf0_base_adrs = radeon_overlay_off;
964 config->offset.y = config->offset.u = config->offset.v = ((left & ~7) << 1)&VIF_BUF0_BASE_ADRS_MASK; 966 config->offset.y = config->offset.u = config->offset.v = ((left & ~7) << 1)&VIF_BUF0_BASE_ADRS_MASK;
965 besr.vid_buf0_base_adrs += config->offset.y; 967 besr.vid_buf0_base_adrs += config->offset.y;
966 besr.vid_buf1_base_adrs = besr.vid_buf0_base_adrs+config->frame_size; 968 besr.vid_buf1_base_adrs = besr.vid_buf0_base_adrs+config->frame_size;
967 besr.vid_buf2_base_adrs = besr.vid_buf0_base_adrs; 969 besr.vid_buf2_base_adrs = besr.vid_buf0_base_adrs;
968 besr.vid_buf3_base_adrs = besr.vif_buf0_base_adrs+config->frame_size; 970 besr.vid_buf3_base_adrs = besr.vid_buf0_base_adrs+config->frame_size;
969 besr.vid_buf4_base_adrs = besr.vid_buf0_base_adrs; 971 besr.vid_buf4_base_adrs = besr.vid_buf0_base_adrs;
970 besr.vid_buf5_base_adrs = besr.vid_buf0_base_adrs+config->frame_size; 972 besr.vid_buf5_base_adrs = besr.vid_buf0_base_adrs+config->frame_size;
971 } 973 }
972 config->offsets[0] = 0; 974 config->offsets[0] = 0;
973 config->offsets[1] = config->frame_size; 975 config->offsets[1] = config->frame_size;