Mercurial > libavcodec.hg
comparison imgconvert.c @ 9519:d42979883bb1 libavcodec
Add 420,422 and 444 planar 16bit per component pix formats.
author | michael |
---|---|
date | Tue, 21 Apr 2009 01:02:48 +0000 |
parents | 5e27a38aeb81 |
children | 9bdf9fe9018c |
comparison
equal
deleted
inserted
replaced
9518:b293cd788af3 | 9519:d42979883bb1 |
---|---|
128 .color_type = FF_COLOR_YUV, | 128 .color_type = FF_COLOR_YUV, |
129 .pixel_type = FF_PIXEL_PLANAR, | 129 .pixel_type = FF_PIXEL_PLANAR, |
130 .depth = 8, | 130 .depth = 8, |
131 .x_chroma_shift = 0, .y_chroma_shift = 1, | 131 .x_chroma_shift = 0, .y_chroma_shift = 1, |
132 }, | 132 }, |
133 [PIX_FMT_YUV420PLE] = { | |
134 .name = "yuv420ple", | |
135 .nb_channels = 3, | |
136 .color_type = FF_COLOR_YUV, | |
137 .pixel_type = FF_PIXEL_PLANAR, | |
138 .depth = 16, | |
139 .x_chroma_shift = 1, .y_chroma_shift = 1, | |
140 }, | |
141 [PIX_FMT_YUV422PLE] = { | |
142 .name = "yuv422ple", | |
143 .nb_channels = 3, | |
144 .color_type = FF_COLOR_YUV, | |
145 .pixel_type = FF_PIXEL_PLANAR, | |
146 .depth = 16, | |
147 .x_chroma_shift = 1, .y_chroma_shift = 0, | |
148 }, | |
149 [PIX_FMT_YUV444PLE] = { | |
150 .name = "yuv444ple", | |
151 .nb_channels = 3, | |
152 .color_type = FF_COLOR_YUV, | |
153 .pixel_type = FF_PIXEL_PLANAR, | |
154 .depth = 16, | |
155 .x_chroma_shift = 0, .y_chroma_shift = 0, | |
156 }, | |
157 [PIX_FMT_YUV420PBE] = { | |
158 .name = "yuv420pbe", | |
159 .nb_channels = 3, | |
160 .color_type = FF_COLOR_YUV, | |
161 .pixel_type = FF_PIXEL_PLANAR, | |
162 .depth = 16, | |
163 .x_chroma_shift = 1, .y_chroma_shift = 1, | |
164 }, | |
165 [PIX_FMT_YUV422PBE] = { | |
166 .name = "yuv422pbe", | |
167 .nb_channels = 3, | |
168 .color_type = FF_COLOR_YUV, | |
169 .pixel_type = FF_PIXEL_PLANAR, | |
170 .depth = 16, | |
171 .x_chroma_shift = 1, .y_chroma_shift = 0, | |
172 }, | |
173 [PIX_FMT_YUV444PBE] = { | |
174 .name = "yuv444pbe", | |
175 .nb_channels = 3, | |
176 .color_type = FF_COLOR_YUV, | |
177 .pixel_type = FF_PIXEL_PLANAR, | |
178 .depth = 16, | |
179 .x_chroma_shift = 0, .y_chroma_shift = 0, | |
180 }, | |
181 | |
133 | 182 |
134 /* YUV formats with alpha plane */ | 183 /* YUV formats with alpha plane */ |
135 [PIX_FMT_YUVA420P] = { | 184 [PIX_FMT_YUVA420P] = { |
136 .name = "yuva420p", | 185 .name = "yuva420p", |
137 .nb_channels = 4, | 186 .nb_channels = 4, |
611 w2 = (width + (1 << pinfo->x_chroma_shift) - 1) >> pinfo->x_chroma_shift; | 660 w2 = (width + (1 << pinfo->x_chroma_shift) - 1) >> pinfo->x_chroma_shift; |
612 picture->linesize[0] = width; | 661 picture->linesize[0] = width; |
613 picture->linesize[1] = w2; | 662 picture->linesize[1] = w2; |
614 picture->linesize[2] = w2; | 663 picture->linesize[2] = w2; |
615 break; | 664 break; |
665 case PIX_FMT_YUV420PLE: | |
666 case PIX_FMT_YUV422PLE: | |
667 case PIX_FMT_YUV444PLE: | |
668 case PIX_FMT_YUV420PBE: | |
669 case PIX_FMT_YUV422PBE: | |
670 case PIX_FMT_YUV444PBE: | |
671 w2 = (width + (1 << pinfo->x_chroma_shift) - 1) >> pinfo->x_chroma_shift; | |
672 picture->linesize[0] = 2*width; | |
673 picture->linesize[1] = 2*w2; | |
674 picture->linesize[2] = 2*w2; | |
675 break; | |
616 case PIX_FMT_YUVA420P: | 676 case PIX_FMT_YUVA420P: |
617 w2 = (width + (1 << pinfo->x_chroma_shift) - 1) >> pinfo->x_chroma_shift; | 677 w2 = (width + (1 << pinfo->x_chroma_shift) - 1) >> pinfo->x_chroma_shift; |
618 picture->linesize[0] = width; | 678 picture->linesize[0] = width; |
619 picture->linesize[1] = w2; | 679 picture->linesize[1] = w2; |
620 picture->linesize[2] = w2; | 680 picture->linesize[2] = w2; |
694 case PIX_FMT_YUV440P: | 754 case PIX_FMT_YUV440P: |
695 case PIX_FMT_YUVJ420P: | 755 case PIX_FMT_YUVJ420P: |
696 case PIX_FMT_YUVJ422P: | 756 case PIX_FMT_YUVJ422P: |
697 case PIX_FMT_YUVJ444P: | 757 case PIX_FMT_YUVJ444P: |
698 case PIX_FMT_YUVJ440P: | 758 case PIX_FMT_YUVJ440P: |
759 case PIX_FMT_YUV420PLE: | |
760 case PIX_FMT_YUV422PLE: | |
761 case PIX_FMT_YUV444PLE: | |
762 case PIX_FMT_YUV420PBE: | |
763 case PIX_FMT_YUV422PBE: | |
764 case PIX_FMT_YUV444PBE: | |
699 h2 = (height + (1 << pinfo->y_chroma_shift) - 1) >> pinfo->y_chroma_shift; | 765 h2 = (height + (1 << pinfo->y_chroma_shift) - 1) >> pinfo->y_chroma_shift; |
700 size2 = picture->linesize[1] * h2; | 766 size2 = picture->linesize[1] * h2; |
701 picture->data[0] = ptr; | 767 picture->data[0] = ptr; |
702 picture->data[1] = picture->data[0] + size; | 768 picture->data[1] = picture->data[0] + size; |
703 picture->data[2] = picture->data[1] + size2; | 769 picture->data[2] = picture->data[1] + size2; |