History

mtv: make output endian independant

should fix fate-mtv test

Michael Niedermayer committed 14 years ago

Commit b9777791 parent 86709ce2 files · +41 −55Browse files

Unified · Split

2 files
  1. libavformat/mtv.c +1 −15
  2. tests/ref/fate/mtv +40 −40
libavformat/mtv.c+1−15
@@ -136,7 +136,7 @@ static int mtv_read_header(AVFormatContext *s) · 135 unmodified lines
136136 avpriv_set_pts_info(st, 64, 1, mtv->video_fps);
137137 st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
138138 st->codec->codec_id = CODEC_ID_RAWVIDEO;
139− st->codec->pix_fmt = PIX_FMT_RGB565;
139+ st->codec->pix_fmt = PIX_FMT_RGB565BE;
140140 st->codec->width = mtv->img_width;
141141 st->codec->height = mtv->img_height;
142142 st->codec->sample_rate = mtv->video_fps;
@@ -169,9 +169,6 @@ static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt) · 26 unmodified lines
169169 MTVDemuxContext *mtv = s->priv_data;
170170 AVIOContext *pb = s->pb;
171171 int ret;
172−#if !HAVE_BIGENDIAN
173− int i;
174−#endif
175172
176173 if((avio_tell(pb) - s->data_offset + mtv->img_segment_size) % mtv->full_segment_size)
177174 {
@@ -190,17 +187,6 @@ static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt) · 12 unmodified lines
190187 if(ret < 0)
191188 return ret;
192189
193−#if !HAVE_BIGENDIAN
194−
195− /* pkt->data is GGGRRRR BBBBBGGG
196− * and we need RRRRRGGG GGGBBBBB
197− * for PIX_FMT_RGB565 so here we
198− * just swap bytes as they come
199− */
200−
201− for(i=0;i<ret/2;i++)
202− *((uint16_t *)pkt->data+i) = av_bswap16(*((uint16_t *)pkt->data+i));
203−#endif
204190 pkt->stream_index = 0;
205191 }
206192
tests/ref/fate/mtv+40−40
@@ -1,138 +1,138 @@
11 #tb 0: 1/16
22 #tb 1: 1/44100
3−0, 0, 0, 1, 12288, 0x80398ebc
3+0, 0, 0, 1, 12288, 0xc2258ebc
44 1, 0, 0, 1152, 417, 0xae1cc66a
55 1, 1152, 1152, 1152, 418, 0xdc3ec850
66 1, 2304, 2304, 1152, 418, 0x4e8ed05f
7−0, 1, 1, 1, 12288, 0x80398ebc
7+0, 1, 1, 1, 12288, 0xc2258ebc
88 1, 3456, 3456, 1152, 418, 0xeb43d574
99 1, 4608, 4608, 1152, 418, 0x9357c91d
10−0, 2, 2, 1, 12288, 0x6678829c
10+0, 2, 2, 1, 12288, 0xb3fe829c
1111 1, 5760, 5760, 1152, 418, 0x5306d16b
1212 1, 6912, 6912, 1152, 418, 0x46e0d4da
1313 1, 8064, 8064, 1152, 418, 0xac11ce79
14−0, 3, 3, 1, 12288, 0xda08884a
14+0, 3, 3, 1, 12288, 0x2315884a
1515 1, 9216, 9216, 1152, 418, 0xffdfc4ad
1616 1, 10368, 10368, 1152, 418, 0xf8a8c2ff
17−0, 4, 4, 1, 12288, 0x45ae8046
17+0, 4, 4, 1, 12288, 0x95a08046
1818 1, 11520, 11520, 1152, 418, 0x2d66d83f
1919 1, 12672, 12672, 1152, 418, 0x65c0da12
20−0, 5, 5, 1, 12288, 0x926c886b
20+0, 5, 5, 1, 12288, 0xdb49886b
2121 1, 13824, 13824, 1152, 418, 0x0eafd20f
2222 1, 14976, 14976, 1152, 418, 0x8c6dd949
2323 1, 16128, 16128, 1152, 418, 0x9094c02d
24−0, 6, 6, 1, 12288, 0x926c886b
24+0, 6, 6, 1, 12288, 0xdb49886b
2525 1, 17280, 17280, 1152, 418, 0xb47bd944
2626 1, 18432, 18432, 1152, 418, 0x935ccce7
27−0, 7, 7, 1, 12288, 0x926c886b
27+0, 7, 7, 1, 12288, 0xdb49886b
2828 1, 19584, 19584, 1152, 418, 0x6e3ed020
2929 1, 20736, 20736, 1152, 418, 0x8922cd6c
3030 1, 21888, 21888, 1152, 418, 0xe811c8f8
31−0, 8, 8, 1, 12288, 0x926c886b
31+0, 8, 8, 1, 12288, 0xdb49886b
3232 1, 23040, 23040, 1152, 418, 0xb84adc72
3333 1, 24192, 24192, 1152, 418, 0xa2bbc5f4
34−0, 9, 9, 1, 12288, 0x926c886b
34+0, 9, 9, 1, 12288, 0xdb49886b
3535 1, 25344, 25344, 1152, 418, 0xec0cb67d
3636 1, 26496, 26496, 1152, 418, 0x89d1d014
37−0, 10, 10, 1, 12288, 0x926c886b
37+0, 10, 10, 1, 12288, 0xdb49886b
3838 1, 27648, 27648, 1152, 418, 0xfb5bc872
3939 1, 28800, 28800, 1152, 417, 0x8bfcc7a0
4040 1, 29952, 29952, 1152, 418, 0xeb4ac61b
41−0, 11, 11, 1, 12288, 0x926c886b
41+0, 11, 11, 1, 12288, 0xdb49886b
4242 1, 31104, 31104, 1152, 418, 0xd3cbc3c4
4343 1, 32256, 32256, 1152, 418, 0xa272d092
44−0, 12, 12, 1, 12288, 0x926c886b
44+0, 12, 12, 1, 12288, 0xdb49886b
4545 1, 33408, 33408, 1152, 418, 0x611ec37e
4646 1, 34560, 34560, 1152, 418, 0x70a3d423
4747 1, 35712, 35712, 1152, 418, 0xeff9ccf4
48−0, 13, 13, 1, 12288, 0x926c886b
48+0, 13, 13, 1, 12288, 0xdb49886b
4949 1, 36864, 36864, 1152, 418, 0x9788c65b
5050 1, 38016, 38016, 1152, 418, 0xe9a8cb8c
51−0, 14, 14, 1, 12288, 0x926c886b
51+0, 14, 14, 1, 12288, 0xdb49886b
5252 1, 39168, 39168, 1152, 418, 0x5834c300
5353 1, 40320, 40320, 1152, 418, 0xa4b8cd3a
54−0, 15, 15, 1, 12288, 0x926c886b
54+0, 15, 15, 1, 12288, 0xdb49886b
5555 1, 41472, 41472, 1152, 418, 0x6de2c7f9
5656 1, 42624, 42624, 1152, 418, 0x961bbbf3
5757 1, 43776, 43776, 1152, 418, 0x53edc13a
58−0, 16, 16, 1, 12288, 0x45ae8046
58+0, 16, 16, 1, 12288, 0x95a08046
5959 1, 44928, 44928, 1152, 418, 0x2fedc4b0
6060 1, 46080, 46080, 1152, 418, 0xb756c18b
61−0, 17, 17, 1, 12288, 0x926c886b
61+0, 17, 17, 1, 12288, 0xdb49886b
6262 1, 47232, 47232, 1152, 418, 0xaf0ed0e4
6363 1, 48384, 48384, 1152, 418, 0x019fd3f0
6464 1, 49536, 49536, 1152, 418, 0x6e29d83e
65−0, 18, 18, 1, 12288, 0x45ae8046
65+0, 18, 18, 1, 12288, 0x95a08046
6666 1, 50688, 50688, 1152, 418, 0x2ddad6bb
6767 1, 51840, 51840, 1152, 418, 0xafefca99
68−0, 19, 19, 1, 12288, 0x926c886b
68+0, 19, 19, 1, 12288, 0xdb49886b
6969 1, 52992, 52992, 1152, 418, 0x366ed013
7070 1, 54144, 54144, 1152, 418, 0x532ac7e0
71−0, 20, 20, 1, 12288, 0x45ae8046
71+0, 20, 20, 1, 12288, 0x95a08046
7272 1, 55296, 55296, 1152, 418, 0x1d0cd1ce
7373 1, 56448, 56448, 1152, 417, 0x572ad1e3
7474 1, 57600, 57600, 1152, 418, 0x858cd91f
75−0, 21, 21, 1, 12288, 0x926c886b
75+0, 21, 21, 1, 12288, 0xdb49886b
7676 1, 58752, 58752, 1152, 418, 0x82cacdfd
7777 1, 59904, 59904, 1152, 418, 0xf4dcc6ed
78−0, 22, 22, 1, 12288, 0x45ae8046
78+0, 22, 22, 1, 12288, 0x95a08046
7979 1, 61056, 61056, 1152, 418, 0x2cf3ca72
8080 1, 62208, 62208, 1152, 418, 0x5963c859
8181 1, 63360, 63360, 1152, 418, 0xa667c53d
82−0, 23, 23, 1, 12288, 0x926c886b
82+0, 23, 23, 1, 12288, 0xdb49886b
8383 1, 64512, 64512, 1152, 418, 0xb2f1d09c
8484 1, 65664, 65664, 1152, 418, 0x2ec1c8d3
85−0, 24, 24, 1, 12288, 0x926c886b
85+0, 24, 24, 1, 12288, 0xdb49886b
8686 1, 66816, 66816, 1152, 418, 0x5754d2e8
8787 1, 67968, 67968, 1152, 418, 0x1956bdba
88−0, 25, 25, 1, 12288, 0x926c886b
88+0, 25, 25, 1, 12288, 0xdb49886b
8989 1, 69120, 69120, 1152, 418, 0x3e18bd55
9090 1, 70272, 70272, 1152, 418, 0xe4cfc339
9191 1, 71424, 71424, 1152, 418, 0xb426c835
92−0, 26, 26, 1, 12288, 0x926c886b
92+0, 26, 26, 1, 12288, 0xdb49886b
9393 1, 72576, 72576, 1152, 418, 0xd7b6cbcf
9494 1, 73728, 73728, 1152, 418, 0x340ec315
95−0, 27, 27, 1, 12288, 0x926c886b
95+0, 27, 27, 1, 12288, 0xdb49886b
9696 1, 74880, 74880, 1152, 418, 0x23a9baec
9797 1, 76032, 76032, 1152, 418, 0x9f04cd01
98−0, 28, 28, 1, 12288, 0x926c886b
98+0, 28, 28, 1, 12288, 0xdb49886b
9999 1, 77184, 77184, 1152, 418, 0xa80ec223
100100 1, 78336, 78336, 1152, 418, 0x23d6bd5d
101101 1, 79488, 79488, 1152, 418, 0xcb25cf5b
102−0, 29, 29, 1, 12288, 0x926c886b
102+0, 29, 29, 1, 12288, 0xdb49886b
103103 1, 80640, 80640, 1152, 418, 0xccccc217
104104 1, 81792, 81792, 1152, 418, 0x757abbfe
105−0, 30, 30, 1, 12288, 0x926c886b
105+0, 30, 30, 1, 12288, 0xdb49886b
106106 1, 82944, 82944, 1152, 418, 0xa2e6cc68
107107 1, 84096, 84096, 1152, 418, 0xdf77cc05
108108 1, 85248, 85248, 1152, 417, 0xe9d2c5d5
109−0, 31, 31, 1, 12288, 0x926c886b
109+0, 31, 31, 1, 12288, 0xdb49886b
110110 1, 86400, 86400, 1152, 418, 0x50dec174
111111 1, 87552, 87552, 1152, 418, 0xf654b27e
112−0, 32, 32, 1, 12288, 0x45ae8046
112+0, 32, 32, 1, 12288, 0x95a08046
113113 1, 88704, 88704, 1152, 418, 0x4d8bc26e
114114 1, 89856, 89856, 1152, 418, 0xccd2bf37
115−0, 33, 33, 1, 12288, 0x926c886b
115+0, 33, 33, 1, 12288, 0xdb49886b
116116 1, 91008, 91008, 1152, 418, 0x6ce2c18a
117117 1, 92160, 92160, 1152, 418, 0xb3cdcf0c
118118 1, 93312, 93312, 1152, 418, 0x55eebe9a
119−0, 34, 34, 1, 12288, 0x45ae8046
119+0, 34, 34, 1, 12288, 0x95a08046
120120 1, 94464, 94464, 1152, 418, 0x9031c9ec
121121 1, 95616, 95616, 1152, 418, 0xb037c49d
122−0, 35, 35, 1, 12288, 0x926c886b
122+0, 35, 35, 1, 12288, 0xdb49886b
123123 1, 96768, 96768, 1152, 418, 0x377bcc78
124124 1, 97920, 97920, 1152, 418, 0x3762c725
125125 1, 99072, 99072, 1152, 418, 0x39afbd4d
126−0, 36, 36, 1, 12288, 0x45ae8046
126+0, 36, 36, 1, 12288, 0x95a08046
127127 1, 100224, 100224, 1152, 418, 0x655ed6cd
128128 1, 101376, 101376, 1152, 418, 0x09aec202
129−0, 37, 37, 1, 12288, 0x926c886b
129+0, 37, 37, 1, 12288, 0xdb49886b
130130 1, 102528, 102528, 1152, 418, 0xf2d2ce55
131131 1, 103680, 103680, 1152, 418, 0x254ebf04
132−0, 38, 38, 1, 12288, 0x45ae8046
132+0, 38, 38, 1, 12288, 0x95a08046
133133 1, 104832, 104832, 1152, 418, 0xa105cdcc
134134 1, 105984, 105984, 1152, 418, 0x1477ba58
135135 1, 107136, 107136, 1152, 418, 0x8d0dcdb2
136−0, 39, 39, 1, 3584, 0xba46c435
136+0, 39, 39, 1, 3584, 0x0354c435
137137 1, 108288, 108288, 1152, 418, 0x0d7cbef4
138138 1, 109440, 109440, 1152, 294, 0x5e2b87c4

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