OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 * | 9 * |
10 * Based on code from the OggTheora software codec source code, | 10 * Based on code from the OggTheora software codec source code, |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 /*Now do the vertical filtering.*/ | 676 /*Now do the vertical filtering.*/ |
677 y4m_422jpeg_420jpeg_helper(_dst, tmp, dst_c_w, c_h); | 677 y4m_422jpeg_420jpeg_helper(_dst, tmp, dst_c_w, c_h); |
678 _dst += dst_c_sz; | 678 _dst += dst_c_sz; |
679 } | 679 } |
680 } | 680 } |
681 | 681 |
682 /*The image is padded with empty chroma components at 4:2:0.*/ | 682 /*The image is padded with empty chroma components at 4:2:0.*/ |
683 static void y4m_convert_mono_420jpeg(y4m_input *_y4m, unsigned char *_dst, | 683 static void y4m_convert_mono_420jpeg(y4m_input *_y4m, unsigned char *_dst, |
684 unsigned char *_aux) { | 684 unsigned char *_aux) { |
685 int c_sz; | 685 int c_sz; |
| 686 (void)_aux; |
686 _dst += _y4m->pic_w * _y4m->pic_h; | 687 _dst += _y4m->pic_w * _y4m->pic_h; |
687 c_sz = ((_y4m->pic_w + _y4m->dst_c_dec_h - 1) / _y4m->dst_c_dec_h) * | 688 c_sz = ((_y4m->pic_w + _y4m->dst_c_dec_h - 1) / _y4m->dst_c_dec_h) * |
688 ((_y4m->pic_h + _y4m->dst_c_dec_v - 1) / _y4m->dst_c_dec_v); | 689 ((_y4m->pic_h + _y4m->dst_c_dec_v - 1) / _y4m->dst_c_dec_v); |
689 memset(_dst, 128, c_sz * 2); | 690 memset(_dst, 128, c_sz * 2); |
690 } | 691 } |
691 | 692 |
692 /*No conversion function needed.*/ | 693 /*No conversion function needed.*/ |
693 static void y4m_convert_null(y4m_input *_y4m, unsigned char *_dst, | 694 static void y4m_convert_null(y4m_input *_y4m, unsigned char *_dst, |
694 unsigned char *_aux) { | 695 unsigned char *_aux) { |
| 696 (void)_y4m; |
| 697 (void)_dst; |
| 698 (void)_aux; |
695 } | 699 } |
696 | 700 |
697 int y4m_input_open(y4m_input *_y4m, FILE *_fin, char *_skip, int _nskip, | 701 int y4m_input_open(y4m_input *_y4m, FILE *_fin, char *_skip, int _nskip, |
698 int only_420) { | 702 int only_420) { |
699 char buffer[80]; | 703 char buffer[80]; |
700 int ret; | 704 int ret; |
701 int i; | 705 int i; |
702 /*Read until newline, or 80 cols, whichever happens first.*/ | 706 /*Read until newline, or 80 cols, whichever happens first.*/ |
703 for (i = 0; i < 79; i++) { | 707 for (i = 0; i < 79; i++) { |
704 if (_nskip > 0) { | 708 if (_nskip > 0) { |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1037 c_sz = c_w * c_h; | 1041 c_sz = c_w * c_h; |
1038 _img->stride[PLANE_Y] = _img->stride[PLANE_ALPHA] = | 1042 _img->stride[PLANE_Y] = _img->stride[PLANE_ALPHA] = |
1039 _y4m->pic_w * bytes_per_sample; | 1043 _y4m->pic_w * bytes_per_sample; |
1040 _img->stride[PLANE_U] = _img->stride[PLANE_V] = c_w; | 1044 _img->stride[PLANE_U] = _img->stride[PLANE_V] = c_w; |
1041 _img->planes[PLANE_Y] = _y4m->dst_buf; | 1045 _img->planes[PLANE_Y] = _y4m->dst_buf; |
1042 _img->planes[PLANE_U] = _y4m->dst_buf + pic_sz; | 1046 _img->planes[PLANE_U] = _y4m->dst_buf + pic_sz; |
1043 _img->planes[PLANE_V] = _y4m->dst_buf + pic_sz + c_sz; | 1047 _img->planes[PLANE_V] = _y4m->dst_buf + pic_sz + c_sz; |
1044 _img->planes[PLANE_ALPHA] = _y4m->dst_buf + pic_sz + 2 * c_sz; | 1048 _img->planes[PLANE_ALPHA] = _y4m->dst_buf + pic_sz + 2 * c_sz; |
1045 return 1; | 1049 return 1; |
1046 } | 1050 } |
OLD | NEW |