Re: [FFmpeg-devel] [PATCH] avformat/mxfenc: Support storing signal standard
On 24/05/15 02:15, Michael Niedermayer wrote: > also store 1 for D10 > > Signed-off-by: Michael Niedermayer > --- > libavformat/mxfenc.c| 11 +++ > tests/ref/lavf/mxf |6 +++--- > tests/ref/lavf/mxf_d10 |2 +- > tests/ref/lavf/mxf_opatom |2 +- > tests/ref/lavf/mxf_opatom_audio |2 +- > 5 files changed, 17 insertions(+), 6 deletions(-) > Do we want to make this an edge case for D10 muxing only, or should we be aiming for it to be more universal? Personally I try to avoid edge cases but I can see that trying to be more universal could be difficult for a number of reasons in this case. If we keep this as an edge case perhaps the commit message should say so:- "Support storing signal standard for D10 muxing" or some such. (I can see a number of similar issues on the horizon too.) -- Tim. Key Fingerprint 38CF DB09 3ED0 F607 8B67 6CED 0C0B FC44 8B0B FC83 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 3/4] avcodec/mips: Disable uni mc optimizations
From: Shivraj Patil Signed-off-by: Shivraj Patil --- libavcodec/mips/hevcdsp_init_mips.c | 35 - libavcodec/mips/hevcdsp_mips.h | 49 - libavcodec/mips/hevcdsp_msa.c | 2482 ++- 3 files changed, 74 insertions(+), 2492 deletions(-) diff --git a/libavcodec/mips/hevcdsp_init_mips.c b/libavcodec/mips/hevcdsp_init_mips.c index d2e3c60..4fec336 100644 --- a/libavcodec/mips/hevcdsp_init_mips.c +++ b/libavcodec/mips/hevcdsp_init_mips.c @@ -61,41 +61,6 @@ static av_cold void hevc_dsp_init_msa(HEVCDSPContext *c, c->put_hevc_qpel[7][1][1] = ff_hevc_put_hevc_qpel_hv32_8_msa; c->put_hevc_qpel[8][1][1] = ff_hevc_put_hevc_qpel_hv48_8_msa; c->put_hevc_qpel[9][1][1] = ff_hevc_put_hevc_qpel_hv64_8_msa; - -c->put_hevc_qpel_uni[3][0][0] = ff_hevc_put_hevc_uni_pel_pixels8_8_msa; -c->put_hevc_qpel_uni[4][0][0] = ff_hevc_put_hevc_uni_pel_pixels12_8_msa; -c->put_hevc_qpel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels16_8_msa; -c->put_hevc_qpel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels24_8_msa; -c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_msa; -c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_msa; -c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_msa; - -c->put_hevc_qpel_uni[1][0][1] = ff_hevc_put_hevc_uni_qpel_h4_8_msa; -c->put_hevc_qpel_uni[3][0][1] = ff_hevc_put_hevc_uni_qpel_h8_8_msa; -c->put_hevc_qpel_uni[4][0][1] = ff_hevc_put_hevc_uni_qpel_h12_8_msa; -c->put_hevc_qpel_uni[5][0][1] = ff_hevc_put_hevc_uni_qpel_h16_8_msa; -c->put_hevc_qpel_uni[6][0][1] = ff_hevc_put_hevc_uni_qpel_h24_8_msa; -c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_8_msa; -c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_8_msa; -c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_8_msa; - -c->put_hevc_qpel_uni[1][1][0] = ff_hevc_put_hevc_uni_qpel_v4_8_msa; -c->put_hevc_qpel_uni[3][1][0] = ff_hevc_put_hevc_uni_qpel_v8_8_msa; -c->put_hevc_qpel_uni[4][1][0] = ff_hevc_put_hevc_uni_qpel_v12_8_msa; -c->put_hevc_qpel_uni[5][1][0] = ff_hevc_put_hevc_uni_qpel_v16_8_msa; -c->put_hevc_qpel_uni[6][1][0] = ff_hevc_put_hevc_uni_qpel_v24_8_msa; -c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_8_msa; -c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_8_msa; -c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_8_msa; - -c->put_hevc_qpel_uni[1][1][1] = ff_hevc_put_hevc_uni_qpel_hv4_8_msa; -c->put_hevc_qpel_uni[3][1][1] = ff_hevc_put_hevc_uni_qpel_hv8_8_msa; -c->put_hevc_qpel_uni[4][1][1] = ff_hevc_put_hevc_uni_qpel_hv12_8_msa; -c->put_hevc_qpel_uni[5][1][1] = ff_hevc_put_hevc_uni_qpel_hv16_8_msa; -c->put_hevc_qpel_uni[6][1][1] = ff_hevc_put_hevc_uni_qpel_hv24_8_msa; -c->put_hevc_qpel_uni[7][1][1] = ff_hevc_put_hevc_uni_qpel_hv32_8_msa; -c->put_hevc_qpel_uni[8][1][1] = ff_hevc_put_hevc_uni_qpel_hv48_8_msa; -c->put_hevc_qpel_uni[9][1][1] = ff_hevc_put_hevc_uni_qpel_hv64_8_msa; } } #endif // #if HAVE_MSA diff --git a/libavcodec/mips/hevcdsp_mips.h b/libavcodec/mips/hevcdsp_mips.h index a8c8848..4f7f273 100644 --- a/libavcodec/mips/hevcdsp_mips.h +++ b/libavcodec/mips/hevcdsp_mips.h @@ -67,52 +67,3 @@ MC(qpel, hv, 48); MC(qpel, hv, 64); #undef MC - -#define UNI_MC(PEL, DIR, WIDTH) \ -void ff_hevc_put_hevc_uni_##PEL##_##DIRWIDTH##_8_msa(uint8_t *dst, \ - ptrdiff_t dst_stride, \ - uint8_t *src, \ - ptrdiff_t src_stride, \ - int height, \ - intptr_t mx, \ - intptr_t my, \ - int width) - -UNI_MC(pel, pixels, 4); -UNI_MC(pel, pixels, 6); -UNI_MC(pel, pixels, 8); -UNI_MC(pel, pixels, 12); -UNI_MC(pel, pixels, 16); -UNI_MC(pel, pixels, 24); -UNI_MC(pel, pixels, 32); -UNI_MC(pel, pixels, 48); -UNI_MC(pel, pixels, 64); - -UNI_MC(qpel, h, 4); -UNI_MC(qpel, h, 8); -UNI_MC(qpel, h, 12); -UNI_MC(qpel, h, 16); -UNI_MC(qpel, h, 24); -UNI_MC(qpel, h, 32); -UNI_MC(qpel, h, 48); -UNI_MC(qpel, h, 64); - -UNI_MC(qpel, v, 4); -UNI_MC(qpel, v, 8); -UNI_MC(qpel, v, 12); -UNI_MC(qpel, v, 16); -UNI_MC(qpel, v, 24); -UNI_MC(qpel, v, 32); -UNI_MC(qpel, v, 48); -UNI_MC(qpel, v, 64); - -UNI_MC(qpel, hv, 4); -UNI_MC(qpel, hv, 8); -UNI_MC(qpel, hv, 12); -UNI_MC(qpel, hv, 16); -UNI_MC(qpel, hv, 24); -UNI_MC(qpel, hv, 32); -UNI_MC(qpel, hv, 48)
[FFmpeg-devel] [PATCH 1/4] avutil/mips: Restructure of generic macros
From: Shivraj Patil Recently we have done little restructuring/styling changes to the optimization sources at our end (like generic macro definitions, their use to reduce code lines, better code alignments etc). This change was also necessary to avoid repeated review comments in remaining patches which we were in process to submit. The above restructuring impacted the already submitted code so we will need to re-submit the accepted code again. We intend to do this as following PATCH 1/4:- Will modify avutil/mips/generic_macros.h PATCH 2/4:- Will modify avcodec/mips/h264dsp_msa.c PATCH 3/4:- Will disable hevc uni mc for time being (will add it in subsequent patches) PATCH 4/4:- Will modify avcodec/mips/hevcdsp_msa.c Overall, the above patches are just upgrading the already accepted code with styling changes and will bring it in sync with our modified codebase. Signed-off-by: Shivraj Patil --- libavutil/mips/generic_macros_msa.h | 2570 +-- 1 file changed, 1279 insertions(+), 1291 deletions(-) diff --git a/libavutil/mips/generic_macros_msa.h b/libavutil/mips/generic_macros_msa.h index 48dc78e..fbe7abf 100644 --- a/libavutil/mips/generic_macros_msa.h +++ b/libavutil/mips/generic_macros_msa.h @@ -24,1403 +24,1391 @@ #include #include -#define LOAD_UB(psrc) \ -( { \ -v16u8 out_m; \ -out_m = *((v16u8 *) (psrc)); \ -out_m;\ -} ) - -#define LOAD_SB(psrc) \ -( { \ -v16i8 out_m; \ -out_m = *((v16i8 *) (psrc)); \ -out_m;\ -} ) +#define LD_B(RTYPE, psrc) *((RTYPE *)(psrc)) +#define LD_UB(...) LD_B(v16u8, __VA_ARGS__) +#define LD_SB(...) LD_B(v16i8, __VA_ARGS__) -#define LOAD_UH(psrc) *((const v8u16 *)(psrc)) +#define LD_H(RTYPE, psrc) *((RTYPE *)(psrc)) +#define LD_SH(...) LD_H(v8i16, __VA_ARGS__) -#define LOAD_SH(psrc) \ -( { \ -v8i16 out_m; \ -out_m = *((v8i16 *) (psrc)); \ -out_m;\ -} ) +#define LD_W(RTYPE, psrc) *((RTYPE *)(psrc)) +#define LD_SW(...) LD_W(v4i32, __VA_ARGS__) -#define LOAD_SW(psrc) *((const v4i32 *)(psrc)) +#define ST_B(RTYPE, in, pdst) *((RTYPE *)(pdst)) = (in) +#define ST_UB(...) ST_B(v16u8, __VA_ARGS__) -#define STORE_UB(vec, pdest) *((v16u8 *)(pdest)) = (vec) -#define STORE_SB(vec, pdest) *((v16i8 *)(pdest)) = (vec) +#define ST_H(RTYPE, in, pdst) *((RTYPE *)(pdst)) = (in) +#define ST_SH(...) ST_H(v8i16, __VA_ARGS__) -#define STORE_SH(vec, pdest) \ -{ \ -*((v8i16 *) (pdest)) = (vec); \ -} - -#define STORE_SW(vec, pdest) \ -{ \ -*((v4i32 *) (pdest)) = (vec); \ -} +#define ST_W(RTYPE, in, pdst) *((RTYPE *)(pdst)) = (in) +#define ST_SW(...) ST_W(v4i32, __VA_ARGS__) #if (__mips_isa_rev >= 6) -#define LOAD_WORD(psrc) \ -( { \ -uint8_t *src_m = (uint8_t *) (psrc); \ -uint32_t val_m; \ - \ -__asm__ volatile (\ -"lw %[val_m], %[src_m] \n\t" \ - \ -: [val_m] "=r" (val_m)\ -: [src_m] "m" (*src_m)\ -);\ - \ -val_m;\ +#define LW(psrc) \ +( {\ +uint8_t *psrc_m = (uint8_t *) (psrc); \ +uint32_t val_m;\ + \ +__asm__ volatile ( \ +"lw %[val_m], %[psrc_m] \n\t" \ + \ +: [val_m] "=r" (val_m) \ +: [psrc_m] "m" (*psrc_m) \ +); \ + \ +val_m; \ } ) #if (__mips == 64) -#define LOAD_DWORD(psrc) \ -( { \ -uint8_t *src_m = (uint8_t *) (psrc); \ -uint64_t val_m = 0; \ - \ -__asm__ volatile (\ -"ld %[val_m], %[src_m] \n\t" \ - \ -: [val_m] "=r" (val_m)\ -: [src_m] "m" (*src_m)\ -);\ - \ -val_m;\ +
[FFmpeg-devel] [PATCH 4/4] avcodec/mips: Restructure as per avutil/mips/generic_macros_msa.h
From: Shivraj Patil Signed-off-by: Shivraj Patil --- libavcodec/mips/hevc_macros_msa.h | 34 + libavcodec/mips/hevcdsp_msa.c | 2428 + 2 files changed, 876 insertions(+), 1586 deletions(-) create mode 100644 libavcodec/mips/hevc_macros_msa.h diff --git a/libavcodec/mips/hevc_macros_msa.h b/libavcodec/mips/hevc_macros_msa.h new file mode 100644 index 000..418c58f --- /dev/null +++ b/libavcodec/mips/hevc_macros_msa.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2015 Manojkumar Bhosale (manojkumar.bhos...@imgtec.com) + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_MIPS_HEVC_MACROS_MSA_H +#define AVCODEC_MIPS_HEVC_MACROS_MSA_H + +#define HEVC_FILT_8TAP(in0, in1, in2, in3, filt0, filt1, filt2, filt3) \ +( { \ +v4i32 out_m;\ +\ +out_m = __msa_dotp_s_w((v8i16) in0, (v8i16) filt0); \ +out_m = __msa_dpadd_s_w(out_m, (v8i16) in1, (v8i16) filt1); \ +DPADD_SH2_SW(in2, in3, filt2, filt3, out_m, out_m); \ +out_m; \ +} ) + +#endif AVCODEC_MIPS_HEVC_MACROS_MSA_H diff --git a/libavcodec/mips/hevcdsp_msa.c b/libavcodec/mips/hevcdsp_msa.c index fcc344b..1ecef0a 100644 --- a/libavcodec/mips/hevcdsp_msa.c +++ b/libavcodec/mips/hevcdsp_msa.c @@ -20,405 +20,181 @@ #include "libavutil/mips/generic_macros_msa.h" #include "libavcodec/mips/hevcdsp_mips.h" +#include "libavcodec/mips/hevc_macros_msa.h" -#define HEVC_FILT_8TAP_DPADD_W(vec0, vec1, vec2, vec3,\ - filt0, filt1, filt2, filt3)\ -( { \ -v4i32 out;\ - \ -out = __msa_dotp_s_w((v8i16) (vec0), (v8i16) (filt0));\ -out = __msa_dpadd_s_w(out, (v8i16) (vec1), (v8i16) (filt1)); \ -out = __msa_dpadd_s_w(out, (v8i16) (vec2), (v8i16) (filt2)); \ -out = __msa_dpadd_s_w(out, (v8i16) (vec3), (v8i16) (filt3)); \ -out; \ -} ) - -#define HEVC_FILT_8TAP_DPADD_H(vec0, vec1, vec2, vec3, \ - filt0, filt1, filt2, filt3, \ - var_in) \ -( { \ -v8i16 out; \ - \ -out = __msa_dpadd_s_h((v8i16) (var_in), (v16i8) (vec0), (v16i8) (filt0)); \ -out = __msa_dpadd_s_h(out, (v16i8) (vec1), (v16i8) (filt1)); \ -out = __msa_dpadd_s_h(out, (v16i8) (vec2), (v16i8) (filt2)); \ -out = __msa_dpadd_s_h(out, (v16i8) (vec3), (v16i8) (filt3)); \ -out; \ -} ) - -static void hevc_copy_4w_msa(uint8_t * __restrict src, int32_t src_stride, - int16_t * __restrict dst, int32_t dst_stride, +static void hevc_copy_4w_msa(uint8_t *src, int32_t src_stride, + int16_t *dst, int32_t dst_stride, int32_t height) { v16i8 zero = { 0 }; if (2 == height) { -uint64_t out0, out1; v16i8 src0, src1; -v8i16 input0; +v8i16 in0; -LOAD_2VECS_SB(src, src_stride, src0, src1); +LD_SB2(src, src_stride, src0, src1); src0 = (v16i8) __msa_ilvr_w((v4i32) src1, (v4i32) src0); - -input0 = (v8i16) __msa_ilvr_b(zero, src0); - -input0 <<= 6; - -out0 = __msa_copy_u_d((v2i64) input0, 0); -out1 = __msa_copy_u_d((v2i64) input0, 1); - -STORE_DWORD(dst, out0); -dst += dst_stride; -STORE_DWORD(dst, out1); +in0 = (v8i16) __msa_ilvr_b(z
[FFmpeg-devel] [PATCH 2/4] avcodec/mips: Restructure as per avutil/mips/generic_macros_msa.h
From: Shivraj Patil Signed-off-by: Shivraj Patil --- libavcodec/mips/h264dsp_msa.c | 1758 +++-- 1 file changed, 634 insertions(+), 1124 deletions(-) diff --git a/libavcodec/mips/h264dsp_msa.c b/libavcodec/mips/h264dsp_msa.c index f728fcc..fce01ac 100644 --- a/libavcodec/mips/h264dsp_msa.c +++ b/libavcodec/mips/h264dsp_msa.c @@ -21,19 +21,16 @@ #include "libavutil/mips/generic_macros_msa.h" #include "h264dsp_mips.h" -static void avc_wgt_4x2_msa(uint8_t *data, -int32_t stride, -int32_t log2_denom, -int32_t src_weight, +static void avc_wgt_4x2_msa(uint8_t *data, int32_t stride, +int32_t log2_denom, int32_t src_weight, int32_t offset_in) { uint32_t data0, data1; v16u8 zero = { 0 }; v16u8 src0, src1; v4i32 res0, res1; -v8i16 temp0, temp1; -v16u8 vec0, vec1; -v8i16 wgt, denom, offset; +v8i16 temp0, temp1, vec0, vec1, wgt, denom, offset; +v8u16 out0, out1; offset_in <<= (log2_denom); @@ -45,53 +42,40 @@ static void avc_wgt_4x2_msa(uint8_t *data, offset = __msa_fill_h(offset_in); denom = __msa_fill_h(log2_denom); -data0 = LOAD_WORD(data); -data1 = LOAD_WORD(data + stride); +data0 = LW(data); +data1 = LW(data + stride); src0 = (v16u8) __msa_fill_w(data0); src1 = (v16u8) __msa_fill_w(data1); -ILVR_B_2VECS_UB(src0, src1, zero, zero, vec0, vec1); +ILVR_B2_SH(zero, src0, zero, src1, vec0, vec1); +MUL2(wgt, vec0, wgt, vec1, temp0, temp1); +ADDS_SH2_SH(temp0, offset, temp1, offset, temp0, temp1); +MAXI_SH2_SH(temp0, temp1, 0); -temp0 = wgt * (v8i16) vec0; -temp1 = wgt * (v8i16) vec1; +out0 = (v8u16) __msa_srl_h(temp0, denom); +out1 = (v8u16) __msa_srl_h(temp1, denom); -temp0 = __msa_adds_s_h(temp0, offset); -temp1 = __msa_adds_s_h(temp1, offset); - -temp0 = __msa_maxi_s_h(temp0, 0); -temp1 = __msa_maxi_s_h(temp1, 0); - -temp0 = __msa_srl_h(temp0, denom); -temp1 = __msa_srl_h(temp1, denom); - -temp0 = (v8i16) __msa_sat_u_h((v8u16) temp0, 7); -temp1 = (v8i16) __msa_sat_u_h((v8u16) temp1, 7); - -res0 = (v4i32) __msa_pckev_b((v16i8) temp0, (v16i8) temp0); -res1 = (v4i32) __msa_pckev_b((v16i8) temp1, (v16i8) temp1); +SAT_UH2_UH(out0, out1, 7); +PCKEV_B2_SW(out0, out0, out1, out1, res0, res1); data0 = __msa_copy_u_w(res0, 0); data1 = __msa_copy_u_w(res1, 0); - -STORE_WORD(data, data0); +SW(data0, data); data += stride; -STORE_WORD(data, data1); +SW(data1, data); } -static void avc_wgt_4x4multiple_msa(uint8_t *data, -int32_t stride, -int32_t height, -int32_t log2_denom, -int32_t src_weight, -int32_t offset_in) +static void avc_wgt_4x4multiple_msa(uint8_t *data, int32_t stride, +int32_t height, int32_t log2_denom, +int32_t src_weight, int32_t offset_in) { uint8_t cnt; uint32_t data0, data1, data2, data3; v16u8 zero = { 0 }; v16u8 src0, src1, src2, src3; -v8u16 temp0, temp1, temp2, temp3; -v8i16 wgt, denom, offset; +v8u16 temp0, temp1, temp2, temp3, wgt; +v8i16 denom, offset; offset_in <<= (log2_denom); @@ -99,63 +83,47 @@ static void avc_wgt_4x4multiple_msa(uint8_t *data, offset_in += (1 << (log2_denom - 1)); } -wgt = __msa_fill_h(src_weight); +wgt = (v8u16) __msa_fill_h(src_weight); offset = __msa_fill_h(offset_in); denom = __msa_fill_h(log2_denom); for (cnt = height / 4; cnt--;) { -LOAD_4WORDS_WITH_STRIDE(data, stride, data0, data1, data2, data3); +LW4(data, stride, data0, data1, data2, data3); src0 = (v16u8) __msa_fill_w(data0); src1 = (v16u8) __msa_fill_w(data1); src2 = (v16u8) __msa_fill_w(data2); src3 = (v16u8) __msa_fill_w(data3); -ILVR_B_4VECS_UH(src0, src1, src2, src3, zero, zero, zero, zero, -temp0, temp1, temp2, temp3); - -temp0 *= wgt; -temp1 *= wgt; -temp2 *= wgt; -temp3 *= wgt; - -ADDS_S_H_4VECS_UH(temp0, offset, temp1, offset, - temp2, offset, temp3, offset, - temp0, temp1, temp2, temp3); - -MAXI_S_H_4VECS_UH(temp0, temp1, temp2, temp3, 0); - -SRL_H_4VECS_UH(temp0, temp1, temp2, temp3, - temp0, temp1, temp2, temp3, denom); - -SAT_U_H_4VECS_UH(temp0, temp1, temp2, temp3, 7); - -PCKEV_B_STORE_4_BYTES_4(temp0, temp1, temp2, temp3, data, stride); +ILVR_B4_UH(zero, src0, zero, src1, zero, src2, zero, src3, + temp0, temp1, temp2, temp3); +
Re: [FFmpeg-devel] [PATCH 3/4] avcodec/mips: Disable uni mc optimizations
On Tue, May 26, 2015 at 04:49:15PM +0530, shivraj.pa...@imgtec.com wrote: > From: Shivraj Patil > > Signed-off-by: Shivraj Patil please include in each patch/commit a commit message which explains what the patch does, why it does it and how it does it (unless its obvious) for example here one wonders why is the code removed ... the commit message should explain this [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If you think the mosad wants you dead since a long time then you are either wrong or dead since a long time. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/4] avutil/mips: Restructure of generic macros
On Tue, May 26, 2015 at 04:49:13PM +0530, shivraj.pa...@imgtec.com wrote: > From: Shivraj Patil > > Recently we have done little restructuring/styling changes to the > optimization sources at our end (like generic macro definitions, their use to > reduce code lines, better code alignments etc). > This change was also necessary to avoid repeated review comments in remaining > patches which we were in process to submit. > The above restructuring impacted the already submitted code so we will need > to re-submit the accepted code again. > > We intend to do this as following > PATCH 1/4:- Will modify avutil/mips/generic_macros.h > PATCH 2/4:- Will modify avcodec/mips/h264dsp_msa.c > PATCH 3/4:- Will disable hevc uni mc for time being (will add it in > subsequent patches) > PATCH 4/4:- Will modify avcodec/mips/hevcdsp_msa.c > > Overall, the above patches are just upgrading the already accepted code with > styling changes and will bring it in sync with our modified codebase. the above describes all patches, but we need a commit message for each patch also messages like "Will modify somefile" are not ok, every commit will modify something, thats too generic and has no real informative content about what is actually done [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB No great genius has ever existed without some touch of madness. -- Aristotle signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/mxfenc: Support storing signal standard
On Tue, May 26, 2015 at 09:45:28AM +0100, tim nicholson wrote: > On 24/05/15 02:15, Michael Niedermayer wrote: > > also store 1 for D10 > > > > Signed-off-by: Michael Niedermayer > > --- > > libavformat/mxfenc.c| 11 +++ > > tests/ref/lavf/mxf |6 +++--- > > tests/ref/lavf/mxf_d10 |2 +- > > tests/ref/lavf/mxf_opatom |2 +- > > tests/ref/lavf/mxf_opatom_audio |2 +- > > 5 files changed, 17 insertions(+), 6 deletions(-) > > > > Do we want to make this an edge case for D10 muxing only, or should we > be aiming for it to be more universal? i dont see how it can be made more universal in a way that has acceptable reliability > > Personally I try to avoid edge cases but I can see that trying to be > more universal could be difficult for a number of reasons in this case. > > If we keep this as an edge case perhaps the commit message should say so:- > > "Support storing signal standard for D10 muxing" ill add that thanks > > or some such. > (I can see a number of similar issues on the horizon too.) > > -- > Tim. > Key Fingerprint 38CF DB09 3ED0 F607 8B67 6CED 0C0B FC44 8B0B FC83 > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws. -- Plato signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avutil: Add av_q2intfloat()
On Sun, May 24, 2015 at 02:33:34PM +0200, Michael Niedermayer wrote: > Signed-off-by: Michael Niedermayer > --- > libavutil/rational.c | 48 > libavutil/rational.h |7 +++ > 2 files changed, 55 insertions(+) applied [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Republics decline into democracies and democracies degenerate into despotisms. -- Aristotle signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avformat/concatdec: Enable auto_convert by default
Users have no means to find out from a failure how to make it work or is it preferred to check and print a warning for h264 concat without auto_convert ? Signed-off-by: Michael Niedermayer --- libavformat/concatdec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c index f07cfd7..07db9f9 100644 --- a/libavformat/concatdec.c +++ b/libavformat/concatdec.c @@ -627,7 +627,7 @@ static const AVOption options[] = { { "safe", "enable safe mode", OFFSET(safe), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 1, DEC }, { "auto_convert", "automatically convert bitstream format", - OFFSET(auto_convert), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC }, + OFFSET(auto_convert), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, DEC }, { NULL } }; -- 1.7.9.5 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH]lavf/riffenc: Set correct block align for mp2
Hi! Attached patch from 2002 fixes ticket #4565. Michael added a comment in 359fa0fe that some demuxers may not like it though. Please comment, Carl Eugen From 816005ddef962b42b48fc5d6dc70b70c7f1f0d72 Mon Sep 17 00:00:00 2001 From: Juanjo Date: Tue, 26 May 2015 23:25:27 +0200 Subject: [PATCH] lavf/riffenc: Set correct block align for mp2. Fixes ticket #4565. Signed-off-by: Carl Eugen Hoyos --- libavformat/riffenc.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/riffenc.c b/libavformat/riffenc.c index d429df0..8373f0b 100644 --- a/libavformat/riffenc.c +++ b/libavformat/riffenc.c @@ -103,7 +103,7 @@ int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc, int flags) } if (enc->codec_id == AV_CODEC_ID_MP2) { -blkalign = frame_size; +blkalign = 144 * enc->bit_rate/enc->sample_rate; } else if (enc->codec_id == AV_CODEC_ID_MP3) { blkalign = 576 * (enc->sample_rate <= (24000 + 32000)/2 ? 1 : 2); } else if (enc->codec_id == AV_CODEC_ID_AC3) { -- 1.7.10.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]lavf/riffenc: Set correct block align for mp2
On Tue, May 26, 2015 at 11:26:25PM +0200, Carl Eugen Hoyos wrote: > Hi! > > Attached patch from 2002 fixes ticket #4565. > Michael added a comment in 359fa0fe that some demuxers > may not like it though. > > Please comment, Carl Eugen [...] > diff --git a/libavformat/riffenc.c b/libavformat/riffenc.c > index d429df0..8373f0b 100644 > --- a/libavformat/riffenc.c > +++ b/libavformat/riffenc.c > @@ -103,7 +103,7 @@ int ff_put_wav_header(AVIOContext *pb, AVCodecContext > *enc, int flags) > } > > if (enc->codec_id == AV_CODEC_ID_MP2) { > -blkalign = frame_size; > +blkalign = 144 * enc->bit_rate/enc->sample_rate; this must be rounded up when its not exact this might work: (144 * enc->bit_rate - 1)/enc->sample_rate + 1; also fate tests need to be updated [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB There will always be a question for which you do not know the correct answer. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] avcodec: loongson3 optimized h264dsp weighted mc with mmi
>From 4c82a8b130b31beb3811dbc22da4b0e8188fa737 Mon Sep 17 00:00:00 2001 From: ZhouXiaoyong Date: Wed, 13 May 2015 22:51:59 +0800 Subject: [PATCH] avcodec: loongson3 optimized h264dsp weighted mc with mmi Signed-off-by: ZhouXiaoyong --- libavcodec/mips/Makefile| 1 + libavcodec/mips/h264dsp_init_mips.c | 21 +++ libavcodec/mips/h264dsp_mips.h | 16 +++ libavcodec/mips/h264dsp_mmi.c | 278 4 files changed, 316 insertions(+) diff --git a/libavcodec/mips/Makefile b/libavcodec/mips/Makefile index eaedd7f..25813e7 100644 --- a/libavcodec/mips/Makefile +++ b/libavcodec/mips/Makefile @@ -22,3 +22,4 @@ OBJS-$(CONFIG_HEVC_DECODER) += mips/hevcdsp_init_mips.o OBJS-$(CONFIG_H264DSP)+= mips/h264dsp_init_mips.o MSA-OBJS-$(CONFIG_HEVC_DECODER) += mips/hevcdsp_msa.o MSA-OBJS-$(CONFIG_H264DSP)+= mips/h264dsp_msa.o +LOONGSON3-OBJS-$(CONFIG_H264DSP) += mips/h264dsp_mmi.o diff --git a/libavcodec/mips/h264dsp_init_mips.c b/libavcodec/mips/h264dsp_init_mips.c index 8d3d760..d9182f2 100644 --- a/libavcodec/mips/h264dsp_init_mips.c +++ b/libavcodec/mips/h264dsp_init_mips.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2015 Parag Salasakar (parag.salasa...@imgtec.com) + * Copyright (c) 2015 Zhou Xiaoyong * * This file is part of FFmpeg. * @@ -65,10 +66,30 @@ static av_cold void h264dsp_init_msa(H264DSPContext *c, } #endif // #if HAVE_MSA +#if HAVE_LOONGSON3 +static av_cold void h264dsp_init_mmi(H264DSPContext * c, + const int bit_depth, + const int chroma_format_idc) +{ +if (bit_depth == 8) { +c->weight_h264_pixels_tab[0] = ff_h264_weight_pixels16_8_mmi; +c->weight_h264_pixels_tab[1] = ff_h264_weight_pixels8_8_mmi; +c->weight_h264_pixels_tab[2] = ff_h264_weight_pixels4_8_mmi; + +c->biweight_h264_pixels_tab[0] = ff_h264_biweight_pixels16_8_mmi; +c->biweight_h264_pixels_tab[1] = ff_h264_biweight_pixels8_8_mmi; +c->biweight_h264_pixels_tab[2] = ff_h264_biweight_pixels4_8_mmi; +} +} +#endif /* HAVE_LOONGSON3 */ + av_cold void ff_h264dsp_init_mips(H264DSPContext *c, const int bit_depth, const int chroma_format_idc) { #if HAVE_MSA h264dsp_init_msa(c, bit_depth, chroma_format_idc); #endif // #if HAVE_MSA +#if HAVE_LOONGSON3 +h264dsp_init_mmi(c, bit_depth, chroma_format_idc); +#endif /* HAVE_LOONGSON3 */ } diff --git a/libavcodec/mips/h264dsp_mips.h b/libavcodec/mips/h264dsp_mips.h index df9b0b2..319f6d3 100644 --- a/libavcodec/mips/h264dsp_mips.h +++ b/libavcodec/mips/h264dsp_mips.h @@ -68,4 +68,20 @@ void ff_weight_h264_pixels8_8_msa(uint8_t *src, int stride, int height, void ff_weight_h264_pixels4_8_msa(uint8_t *src, int stride, int height, int log2_denom, int weight, int offset); +void ff_h264_weight_pixels16_8_mmi(uint8_t *block, int stride, int height, +int log2_denom, int weight, int offset); +void ff_h264_biweight_pixels16_8_mmi(uint8_t *dst, uint8_t *src, +int stride, int height, int log2_denom, int weightd, int weights, +int offset); +void ff_h264_weight_pixels8_8_mmi(uint8_t *block, int stride, int height, +int log2_denom, int weight, int offset); +void ff_h264_biweight_pixels8_8_mmi(uint8_t *dst, uint8_t *src, +int stride, int height, int log2_denom, int weightd, int weights, +int offset); +void ff_h264_weight_pixels4_8_mmi(uint8_t *block, int stride, int height, +int log2_denom, int weight, int offset); +void ff_h264_biweight_pixels4_8_mmi(uint8_t *dst, uint8_t *src, +int stride, int height, int log2_denom, int weightd, int weights, +int offset); + #endif // #ifndef H264_DSP_MIPS_H diff --git a/libavcodec/mips/h264dsp_mmi.c b/libavcodec/mips/h264dsp_mmi.c new file mode 100644 index 000..641cd2f --- /dev/null +++ b/libavcodec/mips/h264dsp_mmi.c @@ -0,0 +1,278 @@ +/* + * Loongson SIMD optimized h264dsp + * + * Copyright (c) 2015 Loongson Technology Corporation Limited + * Copyright (c) 2015 Zhou Xiaoyong + *Zhang Shuangshuang + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
[FFmpeg-devel] [GSoC 2015] Regarding encoding of style descriptors for movtext subtitles
Hi everyone, I was trying to understand how to encode the style descriptors for mov text subtitles. Currently, I am looking at srtenc.c. I see that srt_style_cb() handles the callbacks for styling information, but then what does srt_style_apply() do? I am confused at several other steps too. Can someone please explain briefly how does srt encodes the style descriptors ? Thanks, Niklesh ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] x86/cpu: add AV_CPU_FLAG_AVXSLOW flag
On 22/05/15 11:05 PM, Michael Niedermayer wrote: > On Fri, May 22, 2015 at 10:17:26PM -0300, James Almer wrote: >> Signed-off-by: James Almer >> --- >> doc/APIchanges | 3 +++ >> libavutil/cpu.c | 5 + >> libavutil/cpu.h | 1 + >> libavutil/version.h | 4 ++-- >> libavutil/x86/cpu.c | 17 ++--- >> 5 files changed, 25 insertions(+), 5 deletions(-) > > LGTM > > thanks Pushed. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel