|
46 | 46 | #define __STDC_WANT_LIB_EXT1__ 1 // qsort_s |
47 | 47 |
|
48 | 48 | #include <assert.h> |
| 49 | +#include <libavutil/frame.h> // for AVFrame, av_frame_alloc |
| 50 | +#include <libavutil/pixdesc.h> // for av_get_pix_fmt_name |
| 51 | +#include <limits.h> // for CHAR_BIT |
49 | 52 | #include <stdbool.h> |
| 53 | +#include <stddef.h> // for NULL, ptrdiff_t, size_t |
50 | 54 | #include <stdint.h> |
| 55 | +#include <stdlib.h> // for free, calloc, abort |
| 56 | +#include <string.h> // for memcpy |
51 | 57 |
|
52 | 58 | #include "color_space.h" |
53 | 59 | #include "compat/net.h" // for htonl |
|
56 | 62 | #include "host.h" |
57 | 63 | #include "libavcodec/to_lavc_vid_conv.h" |
58 | 64 | #include "libavcodec/to_lavc_vid_conv_cuda.h" |
| 65 | +#include "libavcodec/utils.h" // for uv_to_av_pixfmt, get_u... |
| 66 | +#include "pixfmt_conv.h" // for get_decoder_from_to |
| 67 | +#include "tv.h" // for get_time_in_ns, time_ns_t |
59 | 68 | #include "utils/macros.h" // OPTIMIZED_FOR |
60 | 69 | #include "utils/parallel_conv.h" |
61 | 70 | #include "utils/worker.h" |
62 | | -#include "video.h" |
| 71 | +#include "video_codec.h" // for vc_get_linesize, get_p... |
| 72 | +#include "video_frame.h" // for buf_get_planes |
63 | 73 |
|
64 | 74 | #ifdef __SSE3__ |
65 | 75 | #include "pmmintrin.h" |
@@ -788,14 +798,12 @@ r12l_to_p210le(AVFrame *__restrict out_frame, |
788 | 798 | } |
789 | 799 |
|
790 | 800 | const int src_linesize = vc_get_linesize(width, R12L); |
791 | | - for (int y = 0; y < height; ++y) { |
792 | | - const unsigned char *src = in_data + y * src_linesize; |
793 | | - uint16_t *dst_y = |
794 | | - (uint16_t *) (void *) (out_frame->data[0] + |
795 | | - out_frame->linesize[0] * y); |
796 | | - uint16_t *dst_cbcr = |
797 | | - (uint16_t *) (void *) (out_frame->data[1] + |
798 | | - out_frame->linesize[1] * y); |
| 801 | + for (size_t y = 0; y < (size_t) height; ++y) { |
| 802 | + const unsigned char *src = in_data + (y * src_linesize); |
| 803 | + uint16_t *dst_y = (void *) (out_frame->data[0] + |
| 804 | + (out_frame->linesize[0] * y)); |
| 805 | + uint16_t *dst_cbcr = (void *) (out_frame->data[1] + |
| 806 | + (out_frame->linesize[1] * y)); |
799 | 807 |
|
800 | 808 | OPTIMIZED_FOR(int x = 0; x < width; x += 8) |
801 | 809 | { |
@@ -906,11 +914,10 @@ r12l_to_ayuv64le(AVFrame *__restrict out_frame, |
906 | 914 | *dst++ = CLAMP_LIMITED_CBCR(res_cr, depth); |
907 | 915 |
|
908 | 916 | const int src_linesize = vc_get_linesize(width, R12L); |
909 | | - for (int y = 0; y < height; ++y) { |
910 | | - const unsigned char *src = in_data + y * src_linesize; |
911 | | - uint16_t *dst = |
912 | | - (uint16_t *) (void *) (out_frame->data[0] + |
913 | | - out_frame->linesize[0] * y); |
| 917 | + for (size_t y = 0; y < (size_t) height; ++y) { |
| 918 | + const unsigned char *src = in_data + (y * src_linesize); |
| 919 | + uint16_t *dst = (void *) (out_frame->data[0] + |
| 920 | + (out_frame->linesize[0] * y)); |
914 | 921 |
|
915 | 922 | OPTIMIZED_FOR(int x = 0; x < width; x += 8) |
916 | 923 | { |
|
0 commit comments