Showing the changes to libavcodec (2 of 2 files). Show all
Unified · Split
| @@ -2377,7 +2377,7 @@ int ff_mjpeg_decode_frame_from_buf(AVCodecContext *avctx, AVFrame *frame, · 2376 unmodified lines | |||
| 2377 | int hshift, vshift; | 2377 | int hshift, vshift; |
| 2378 | int unescaped_buf_size; | 2378 | int unescaped_buf_size; |
| 2379 | int start_code; | 2379 | int start_code; |
| 2380 | int i, index; | 2380 | int index; |
| 2381 | int ret = 0; | 2381 | int ret = 0; |
| 2382 | int is16bit; | 2382 | int is16bit; |
| 2383 | AVDictionaryEntry *e = NULL; | 2383 | AVDictionaryEntry *e = NULL; |
| @@ -2657,7 +2657,7 @@ the_end: · 273 unmodified lines | |||
| 2657 | if (s->upscale_v[p] == 1) | 2657 | if (s->upscale_v[p] == 1) |
| 2658 | h = (h+1)>>1; | 2658 | h = (h+1)>>1; |
| 2659 | av_assert0(w > 0); | 2659 | av_assert0(w > 0); |
| 2660 | for (i = 0; i < h; i++) { | 2660 | for (int i = 0; i < h; i++) { |
| 2661 | if (s->upscale_h[p] == 1) { | 2661 | if (s->upscale_h[p] == 1) { |
| 2662 | if (is16bit) ((uint16_t*)line)[w - 1] = ((uint16_t*)line)[(w - 1) / 2]; | 2662 | if (is16bit) ((uint16_t*)line)[w - 1] = ((uint16_t*)line)[(w - 1) / 2]; |
| 2663 | else line[w - 1] = line[(w - 1) / 2]; | 2663 | else line[w - 1] = line[(w - 1) / 2]; |
| @@ -2735,7 +2735,7 @@ the_end: · 71 unmodified lines | |||
| 2735 | h = AV_CEIL_RSHIFT(h, vshift); | 2735 | h = AV_CEIL_RSHIFT(h, vshift); |
| 2736 | } | 2736 | } |
| 2737 | dst = &((uint8_t *)s->picture_ptr->data[p])[(h - 1) * s->linesize[p]]; | 2737 | dst = &((uint8_t *)s->picture_ptr->data[p])[(h - 1) * s->linesize[p]]; |
| 2738 | for (i = h - 1; i; i--) { | 2738 | for (int i = h - 1; i; i--) { |
| 2739 | uint8_t *src1 = &((uint8_t *)s->picture_ptr->data[p])[i * s->upscale_v[p] / (s->upscale_v[p] + 1) * s->linesize[p]]; | 2739 | uint8_t *src1 = &((uint8_t *)s->picture_ptr->data[p])[i * s->upscale_v[p] / (s->upscale_v[p] + 1) * s->linesize[p]]; |
| 2740 | uint8_t *src2 = &((uint8_t *)s->picture_ptr->data[p])[(i + 1) * s->upscale_v[p] / (s->upscale_v[p] + 1) * s->linesize[p]]; | 2740 | uint8_t *src2 = &((uint8_t *)s->picture_ptr->data[p])[(i + 1) * s->upscale_v[p] / (s->upscale_v[p] + 1) * s->linesize[p]]; |
| 2741 | if (s->upscale_v[p] != 2 && (src1 == src2 || i == h - 1)) { | 2741 | if (s->upscale_v[p] != 2 && (src1 == src2 || i == h - 1)) { |
| @@ -2777,7 +2777,7 @@ the_end: · 35 unmodified lines | |||
| 2777 | int w = s->picture_ptr->width; | 2777 | int w = s->picture_ptr->width; |
| 2778 | int h = s->picture_ptr->height; | 2778 | int h = s->picture_ptr->height; |
| 2779 | av_assert0(s->nb_components == 4); | 2779 | av_assert0(s->nb_components == 4); |
| 2780 | for (i=0; i<h; i++) { | 2780 | for (int i = 0; i < h; i++) { |
| 2781 | int j; | 2781 | int j; |
| 2782 | uint8_t *dst[4]; | 2782 | uint8_t *dst[4]; |
| 2783 | for (index=0; index<4; index++) { | 2783 | for (index=0; index<4; index++) { |
| @@ -2800,7 +2800,7 @@ the_end: · 16 unmodified lines | |||
| 2800 | int w = s->picture_ptr->width; | 2800 | int w = s->picture_ptr->width; |
| 2801 | int h = s->picture_ptr->height; | 2801 | int h = s->picture_ptr->height; |
| 2802 | av_assert0(s->nb_components == 4); | 2802 | av_assert0(s->nb_components == 4); |
| 2803 | for (i=0; i<h; i++) { | 2803 | for (int i = 0; i < h; i++) { |
| 2804 | int j; | 2804 | int j; |
| 2805 | uint8_t *dst[4]; | 2805 | uint8_t *dst[4]; |
| 2806 | for (index=0; index<4; index++) { | 2806 | for (index=0; index<4; index++) { |
| @@ -2833,10 +2833,9 @@ the_end: · 26 unmodified lines | |||
| 2833 | AVFrameSideData *sd; | 2833 | AVFrameSideData *sd; |
| 2834 | size_t offset = 0; | 2834 | size_t offset = 0; |
| 2835 | int total_size = 0; | 2835 | int total_size = 0; |
| 2836 | int i; | ||
| 2837 | 2836 | ||
| 2838 | /* Sum size of all parts. */ | 2837 | /* Sum size of all parts. */ |
| 2839 | for (i = 0; i < s->iccnum; i++) | 2838 | for (int i = 0; i < s->iccnum; i++) |
| 2840 | total_size += s->iccentries[i].length; | 2839 | total_size += s->iccentries[i].length; |
| 2841 | 2840 | ||
| 2842 | ret = ff_frame_new_side_data(avctx, frame, AV_FRAME_DATA_ICC_PROFILE, total_size, &sd); | 2841 | ret = ff_frame_new_side_data(avctx, frame, AV_FRAME_DATA_ICC_PROFILE, total_size, &sd); |
| @@ -2847,7 +2846,7 @@ the_end: · 4 unmodified lines | |||
| 2847 | 2846 | ||
| 2848 | if (sd) { | 2847 | if (sd) { |
| 2849 | /* Reassemble the parts, which are now in-order. */ | 2848 | /* Reassemble the parts, which are now in-order. */ |
| 2850 | for (i = 0; i < s->iccnum; i++) { | 2849 | for (int i = 0; i < s->iccnum; i++) { |
| 2851 | memcpy(sd->data + offset, s->iccentries[i].data, s->iccentries[i].length); | 2850 | memcpy(sd->data + offset, s->iccentries[i].data, s->iccentries[i].length); |
| 2852 | offset += s->iccentries[i].length; | 2851 | offset += s->iccentries[i].length; |
| 2853 | } | 2852 | } |
| @@ -39,18 +39,17 @@ · 38 unmodified lines | |||
| 39 | static int put_huffman_table(PutBitContext *p, int table_class, int table_id, | 39 | static int put_huffman_table(PutBitContext *p, int table_class, int table_id, |
| 40 | const uint8_t *bits_table, const uint8_t *value_table) | 40 | const uint8_t *bits_table, const uint8_t *value_table) |
| 41 | { | 41 | { |
| 42 | int n, i; | 42 | int n = 0; |
| 43 | 43 | ||
| 44 | put_bits(p, 4, table_class); | 44 | put_bits(p, 4, table_class); |
| 45 | put_bits(p, 4, table_id); | 45 | put_bits(p, 4, table_id); |
| 46 | 46 | ||
| 47 | n = 0; | 47 | for (int i = 1; i <= 16; i++) { |
| 48 | for(i=1;i<=16;i++) { | ||
| 49 | n += bits_table[i]; | 48 | n += bits_table[i]; |
| 50 | put_bits(p, 8, bits_table[i]); | 49 | put_bits(p, 8, bits_table[i]); |
| 51 | } | 50 | } |
| 52 | 51 | ||
| 53 | for(i=0;i<n;i++) | 52 | for (int i = 0; i < n; i++) |
| 54 | put_bits(p, 8, value_table[i]); | 53 | put_bits(p, 8, value_table[i]); |
| 55 | 54 | ||
| 56 | return n + 17; | 55 | return n + 17; |
| @@ -63,7 +62,7 @@ static void jpeg_table_header(AVCodecContext *avctx, PutBitContext *p, · 6 unmodified lines | |||
| 63 | uint16_t chroma_intra_matrix[64], | 62 | uint16_t chroma_intra_matrix[64], |
| 64 | int hsample[3], int use_slices, int matrices_differ) | 63 | int hsample[3], int use_slices, int matrices_differ) |
| 65 | { | 64 | { |
| 66 | int i, j, size; | 65 | int size; |
| 67 | uint8_t *ptr; | 66 | uint8_t *ptr; |
| 68 | 67 | ||
| 69 | if (m) { | 68 | if (m) { |
| @@ -83,8 +82,8 @@ static void jpeg_table_header(AVCodecContext *avctx, PutBitContext *p, · 13 unmodified lines | |||
| 83 | if (matrix_count > 1) { | 82 | if (matrix_count > 1) { |
| 84 | put_bits(p, 4, 0); /* 8 bit precision */ | 83 | put_bits(p, 4, 0); /* 8 bit precision */ |
| 85 | put_bits(p, 4, 1); /* table 1 */ | 84 | put_bits(p, 4, 1); /* table 1 */ |
| 86 | for(i=0;i<64;i++) { | 85 | for (int i = 0; i < 64; i++) { |
| 87 | j = intra_matrix_permutation[i]; | 86 | uint8_t j = intra_matrix_permutation[i]; |
| 88 | put_bits(p, 8, chroma_intra_matrix[j]); | 87 | put_bits(p, 8, chroma_intra_matrix[j]); |
| 89 | } | 88 | } |
| 90 | } | 89 | } |