-
Notifications
You must be signed in to change notification settings - Fork 13
Add -Wconversion and fix the related conversion issues #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
0d8caaa
5b15481
7a4f04f
7c0fab6
feb6dc5
bf1a4cc
a131d28
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,7 @@ | |
| #include "VulkanH26xDecoder.h" | ||
| #include "nvVulkanh264ScalingList.h" | ||
|
|
||
| #define VK_H264_SPS_VUI_FIELD(pStdVui, nvSpsIn, name) pStdVui->name = nvSpsIn->vui.name | ||
| #define VK_H264_SPS_VUI_FIELD(pStdVui, nvSpsIn, name) pStdVui->name = (uint8_t)(nvSpsIn->vui.name) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is correct. Not all SPS_VUI fields are uint8_t. This will create a big issue on truncating types. |
||
| #define SET_VK_H264_SPS_VUI_FIELD(pStdVui, name, value) pStdVui->name = value | ||
| #define VK_H264_SPS_VUI_FLAG(pStdVui, nvSpsIn, name) pStdVui->flags.name = nvSpsIn->vui.name | ||
|
|
||
|
|
@@ -76,19 +76,19 @@ struct vui_parameters_s | |
|
|
||
| struct seq_parameter_set_svc_extension_s | ||
| { | ||
| int inter_layer_deblocking_filter_control_present_flag; | ||
| int extended_spatial_scalability_idc; | ||
| int chroma_phase_x_plus1_flag; | ||
| int chroma_phase_y_plus1; | ||
| int seq_ref_layer_chroma_phase_x_plus1_flag; | ||
| int seq_ref_layer_chroma_phase_y_plus1; | ||
| int seq_scaled_ref_layer_left_offset; | ||
| int seq_scaled_ref_layer_top_offset; | ||
| int seq_scaled_ref_layer_right_offset; | ||
| int seq_scaled_ref_layer_bottom_offset; | ||
| int seq_tcoeff_level_prediction_flag; | ||
| int adaptive_tcoeff_level_prediction_flag; | ||
| int slice_header_restriction_flag; | ||
| uint32_t inter_layer_deblocking_filter_control_present_flag; | ||
| uint32_t extended_spatial_scalability_idc; | ||
| uint32_t chroma_phase_x_plus1_flag; | ||
| uint32_t chroma_phase_y_plus1; | ||
| uint32_t seq_ref_layer_chroma_phase_x_plus1_flag; | ||
| uint32_t seq_ref_layer_chroma_phase_y_plus1; | ||
| uint32_t seq_scaled_ref_layer_left_offset; | ||
| uint32_t seq_scaled_ref_layer_top_offset; | ||
| uint32_t seq_scaled_ref_layer_right_offset; | ||
| uint32_t seq_scaled_ref_layer_bottom_offset; | ||
| uint32_t seq_tcoeff_level_prediction_flag; | ||
| uint32_t adaptive_tcoeff_level_prediction_flag; | ||
| uint32_t slice_header_restriction_flag; | ||
| }; | ||
|
|
||
| struct seq_parameter_set_s : public StdVideoPictureParametersSet, public StdVideoH264SequenceParameterSet | ||
|
|
@@ -233,8 +233,8 @@ struct seq_parameter_set_s : public StdVideoPictureParametersSet, public StdVide | |
|
|
||
| // StdVideoH264HrdParameters hrd_parameters); | ||
| pStdHrdParameters->cpb_cnt_minus1 = pSps->vui.nal_hrd.cpb_cnt_minus1; | ||
| pStdHrdParameters->bit_rate_scale = pSps->vui.nal_hrd.bit_rate; | ||
| pStdHrdParameters->cpb_size_scale = pSps->vui.nal_hrd.cbp_size; | ||
| pStdHrdParameters->bit_rate_scale = (uint8_t)(pSps->vui.nal_hrd.bit_rate); | ||
| pStdHrdParameters->cpb_size_scale =(uint8_t)(pSps->vui.nal_hrd.cbp_size); | ||
| // stdVui.pHrdParameters->bit_rate_value_minus1[32]; | ||
| // stdVui.pHrdParameters->cpb_size_value_minus1[32]; | ||
| // stdVui.pHrdParameters->cbr_flag[32]; | ||
|
|
@@ -544,7 +544,7 @@ struct slice_header_s | |
| int first_mb_in_slice; | ||
| int slice_type_raw; | ||
| int slice_type; | ||
| int pic_parameter_set_id; | ||
| uint8_t pic_parameter_set_id; | ||
| int colour_plane_id; | ||
| int frame_num; | ||
| int idr_pic_id; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,7 @@ size_t VulkanVideoDecoder::next_start_code<SIMD_ISA::AVX2>(const uint8_t *pdatai | |
| { | ||
| const __m256i v1 = _mm256_set1_epi8(1); | ||
| __m256i vdata = _mm256_loadu_si256((const __m256i*)pdatain); | ||
| __m256i vBfr = _mm256_set1_epi16(((m_BitBfr << 8) & 0xFF00) | ((m_BitBfr >> 8) & 0xFF)); | ||
| __m256i vBfr = _mm256_set1_epi16((((int16_t)m_BitBfr << 8) & 0xFF00) | (((short)m_BitBfr >> 8) & 0xFF)); | ||
| __m256i vdata_alignr16b_init = _mm256_permute2f128_si256(vBfr, vdata, 1 | (2<<4)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. short -> int16_t |
||
| __m256i vdata_prev1 = _mm256_alignr_epi8(vdata, vdata_alignr16b_init, 15); | ||
| __m256i vdata_prev2 = _mm256_alignr_epi8(vdata, vdata_alignr16b_init, 14); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ size_t VulkanVideoDecoder::next_start_code<SIMD_ISA::AVX512>(const uint8_t *pdat | |
| const __m512i v1 = _mm512_set1_epi8(1); | ||
| const __m512i v254 = _mm512_set1_epi8(-2); | ||
| __m512i vdata = _mm512_loadu_si512((const void*)pdatain); | ||
| __m512i vBfr = _mm512_set1_epi16(((m_BitBfr << 8) & 0xFF00) | ((m_BitBfr >> 8) & 0xFF)); | ||
| __m512i vBfr = _mm512_set1_epi16((((int16_t)m_BitBfr << 8) & 0xFF00) | (((short)m_BitBfr >> 8) & 0xFF)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. short -> int16_t |
||
| __m512i vdata_alignr48b_init = _mm512_alignr_epi32(vdata, vBfr, 12); | ||
| __m512i vdata_prev1 = _mm512_alignr_epi8(vdata, vdata_alignr48b_init, 15); | ||
| __m512i vdata_prev2 = _mm512_alignr_epi8(vdata, vdata_alignr48b_init, 14); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,7 @@ size_t VulkanVideoDecoder::next_start_code<SIMD_ISA::SSSE3>(const uint8_t *pdata | |
| { | ||
| const __m128i v1 = _mm_set1_epi8(1); | ||
| __m128i vdata = _mm_loadu_si128((const __m128i*)pdatain); | ||
| __m128i vBfr = _mm_set1_epi16(((m_BitBfr << 8) & 0xFF00) | ((m_BitBfr >> 8) & 0xFF)); | ||
| __m128i vBfr = _mm_set1_epi16((((int16_t)m_BitBfr << 8) & 0xFF00) | (((short)m_BitBfr >> 8) & 0xFF)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. short -> int16_t |
||
| __m128i vdata_prev1 = _mm_alignr_epi8(vdata, vBfr, 15); | ||
| __m128i vdata_prev2 = _mm_alignr_epi8(vdata, vBfr, 14); | ||
| for ( ; i < datasize32 - 32; i += 32) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.