History

Revert "Allow stream-copying grayscale mov files."

This reverts commit 691dec62011fe9993809fbc793126b40cac0c584. The commit did not fix ticket #3215, it was fixed one commit earlier. The revert may break other use-cases but they should be fixed differently, the offending commit introduced too many problems. Fixes ticket #3377. Fixes ticket #3378.

Carl Eugen Hoyos committed 12 years ago

Commit 54bbe3e1 parent 5d757304 files · +7 −6Browse files

Unified · Split

4 files
  1. libavcodec/8bps.c +1 −1
  2. libavcodec/msrle.c +1 −1
  3. libavcodec/rawdec.c +4 −4
  4. libavformat/mov.c +1 −0
libavcodec/8bps.c+1−1
@@ -119,7 +119,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, · 118 unmodified lines
119 }119 }
120 }120 }
121 121
122 if ((avctx->bits_per_coded_sample & 0x1f) <= 8) {122 if (avctx->bits_per_coded_sample <= 8) {
123 const uint8_t *pal = av_packet_get_side_data(avpkt,123 const uint8_t *pal = av_packet_get_side_data(avpkt,
124 AV_PKT_DATA_PALETTE,124 AV_PKT_DATA_PALETTE,
125 NULL);125 NULL);
libavcodec/msrle.c+1−1
@@ -55,7 +55,7 @@ static av_cold int msrle_decode_init(AVCodecContext *avctx) · 54 unmodified lines
55 55
56 s->avctx = avctx;56 s->avctx = avctx;
57 57
58 switch (avctx->bits_per_coded_sample & 0x1f) {58 switch (avctx->bits_per_coded_sample) {
59 case 1:59 case 1:
60 avctx->pix_fmt = AV_PIX_FMT_MONOWHITE;60 avctx->pix_fmt = AV_PIX_FMT_MONOWHITE;
61 break;61 break;
libavcodec/rawdec.c+4−4
@@ -109,7 +109,7 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx) · 108 unmodified lines
109 if ( avctx->codec_tag == MKTAG('r','a','w',' ')109 if ( avctx->codec_tag == MKTAG('r','a','w',' ')
110 || avctx->codec_tag == MKTAG('N','O','1','6'))110 || avctx->codec_tag == MKTAG('N','O','1','6'))
111 avctx->pix_fmt = avpriv_find_pix_fmt(pix_fmt_bps_mov,111 avctx->pix_fmt = avpriv_find_pix_fmt(pix_fmt_bps_mov,
112 avctx->bits_per_coded_sample & 0x1f);112 avctx->bits_per_coded_sample);
113 else if (avctx->codec_tag == MKTAG('W', 'R', 'A', 'W'))113 else if (avctx->codec_tag == MKTAG('W', 'R', 'A', 'W'))
114 avctx->pix_fmt = avpriv_find_pix_fmt(pix_fmt_bps_avi,114 avctx->pix_fmt = avpriv_find_pix_fmt(pix_fmt_bps_avi,
115 avctx->bits_per_coded_sample);115 avctx->bits_per_coded_sample);
@@ -135,7 +135,7 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx) · 19 unmodified lines
135 memset(context->palette->data, 0, AVPALETTE_SIZE);135 memset(context->palette->data, 0, AVPALETTE_SIZE);
136 }136 }
137 137
138 if (((avctx->bits_per_coded_sample & 0x1f) == 4 || (avctx->bits_per_coded_sample & 0x1f) == 2) &&138 if ((avctx->bits_per_coded_sample == 4 || avctx->bits_per_coded_sample == 2) &&
139 avctx->pix_fmt == AV_PIX_FMT_PAL8 &&139 avctx->pix_fmt == AV_PIX_FMT_PAL8 &&
140 (!avctx->codec_tag || avctx->codec_tag == MKTAG('r','a','w',' '))) {140 (!avctx->codec_tag || avctx->codec_tag == MKTAG('r','a','w',' '))) {
141 context->is_2_4_bpp = 1;141 context->is_2_4_bpp = 1;
@@ -209,14 +209,14 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame, · 67 unmodified lines
209 int i;209 int i;
210 uint8_t *dst = frame->buf[0]->data;210 uint8_t *dst = frame->buf[0]->data;
211 buf_size = context->frame_size - AVPALETTE_SIZE;211 buf_size = context->frame_size - AVPALETTE_SIZE;
212 if ((avctx->bits_per_coded_sample & 0x1f) == 4) {212 if (avctx->bits_per_coded_sample == 4) {
213 for (i = 0; 2 * i + 1 < buf_size && i<avpkt->size; i++) {213 for (i = 0; 2 * i + 1 < buf_size && i<avpkt->size; i++) {
214 dst[2 * i + 0] = buf[i] >> 4;214 dst[2 * i + 0] = buf[i] >> 4;
215 dst[2 * i + 1] = buf[i] & 15;215 dst[2 * i + 1] = buf[i] & 15;
216 }216 }
217 linesize_align = 8;217 linesize_align = 8;
218 } else {218 } else {
219 av_assert0((avctx->bits_per_coded_sample & 0x1f) == 2);219 av_assert0(avctx->bits_per_coded_sample == 2);
220 for (i = 0; 4 * i + 3 < buf_size && i<avpkt->size; i++) {220 for (i = 0; 4 * i + 3 < buf_size && i<avpkt->size; i++) {
221 dst[4 * i + 0] = buf[i] >> 6;221 dst[4 * i + 0] = buf[i] >> 6;
222 dst[4 * i + 1] = buf[i] >> 4 & 3;222 dst[4 * i + 1] = buf[i] >> 4 & 3;
libavformat/mov.c+1−0
@@ -1330,6 +1330,7 @@ static void mov_parse_stsd_video(MOVContext *c, AVIOContext *pb, · 1329 unmodified lines
1330 if (color_greyscale) {1330 if (color_greyscale) {
1331 int color_index, color_dec;1331 int color_index, color_dec;
1332 /* compute the greyscale palette */1332 /* compute the greyscale palette */
1333 st->codec->bits_per_coded_sample = color_depth;
1333 color_count = 1 << color_depth;1334 color_count = 1 << color_depth;
1334 color_index = 255;1335 color_index = 255;
1335 color_dec = 256 / (color_count - 1);1336 color_dec = 256 / (color_count - 1);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t