Re: [FFmpeg-devel] [PATCH] avcodec/alac: don't fail if channels aren't set during init() when extradata is valid
On Sat, Jul 30, 2022 at 12:09 AM James Almer wrote: > > The decoder is meant to use it as a fallback if the value in extradata is > invalid. > > Regression since d199099be. > Had the person doing API client usage who reported this to me test the patch, it fixes the issue. LGTM. Would probably be worth it to back-port this to release/5.1 . Jan ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 34/39] avcodec/mpegvideoencdsp: Allow pointers to const where possible
Michael Niedermayer: > On Wed, Jul 27, 2022 at 12:08:09AM +0200, Andreas Rheinhardt wrote: >> Signed-off-by: Andreas Rheinhardt >> --- >> libavcodec/arm/mpegvideoencdsp_init_arm.c | 4 ++-- >> libavcodec/mips/h263dsp_mips.h | 2 +- >> libavcodec/mips/mpegvideoencdsp_msa.c | 4 ++-- >> libavcodec/mpegvideoencdsp.c | 10 +- >> libavcodec/mpegvideoencdsp.h | 10 +- >> libavcodec/ppc/mpegvideoencdsp.c | 8 >> libavcodec/x86/mpegvideoenc_qns_template.c | 4 ++-- >> libavcodec/x86/mpegvideoencdsp.asm | 4 ++-- >> libavcodec/x86/mpegvideoencdsp_init.c | 6 +++--- >> 9 files changed, 26 insertions(+), 26 deletions(-) > > LGTM, also all similar things should be ok > > [...] > Unfortunately, it is not so easy. The first version of this patchset (this here) forgot to update the definitions of several loongarch functions, leading to lots of red on patchwork. The second version fixed the compilation error, but forgot some constifications due to unfortunate oversights. For the third version, I wanted to actually compile loongarch instead of just staring at the code; but the GCC-cross-compiler does not seem to support lsx and lasx (and looking at the loongarch-code in GCC makes me believe that they are just not supported (yet)). Therefore I resorted to creating dummy-functions for all the __lasx_* and __lsx_* functions (they show no more const-warnings). I wanted to let the FATE-loongarch-box test this once more (and tell me whether there are still any issues left), yet this box is no longer active since a few days (for reasons unknown). Can you compile the lsx and lasx code (after all, you committed all the loongarch code)? - Andreas ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v4 0/7] ICC profile support in avcodec
Merged as 1001bdc504. On Thu, 28 Jul 2022 16:49:55 +0200 Niklas Haas wrote: > This tidies up the previous patchset slightly and adds the necessary > user-facing bits to make it actually usable, plus tests. > > Will merge this soon since there was no additional feedback on v3. > > Changes in v4: > - add the "icc_profiles" option to "flags2", and document it > - fix the corresponding check in avcodec/decode.c > - add FATE test for the new functionality > > Changes in v3: > - switch from `int icc_profiles` to a new AV_CODEC_FLAG2 to avoid ABI > break > - rebased onto master and fixed merge conflicts > > Changes in v2: > - remove unnecessary import > - fixed assignment-instead-of-equality > - fixed #ifdef -> #if > > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avcodec/alac: don't fail if channels aren't set during init() when extradata is valid
On Sat, 30 Jul 2022, at 11:41, Jan Ekström wrote: > Had the person doing API client usage who reported this to me test the > patch, it fixes the issue. > > LGTM. > > Would probably be worth it to back-port this to release/5.1 . I agree. -- Jean-Baptiste Kempf - President +33 672 704 734 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v2 1/2] lavfi/edge_common: Add 16bit versions of gaussian_blur and sobel
Am 29.07.22 um 15:11 schrieb Thilo Borgmann: Hi, 1/2 adds 16 bit versions of ff_gaussian_blur and ff_sobel. 2/2 adds new mode to cropdetect. v3 does it the template way for 1/2 as requested on IRC. v4 fixed bug in gaussian_blur. Otherwise identical. v5 fixes minor things mentioned on IRC and another bug found on the way. will push v5 patchiest soon if there are no more comments. Patchset OK'd on IRC and pushed. Thanks! -Thilo ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 1/2] avcodec/aacdec_fixed: add missing priv_class
This enables the same input options as the float decoder. Signed-off-by: James Almer --- libavcodec/aacdec_fixed.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c index 392a85e46a..ddfa160adc 100644 --- a/libavcodec/aacdec_fixed.c +++ b/libavcodec/aacdec_fixed.c @@ -468,6 +468,7 @@ const FFCodec ff_aac_fixed_decoder = { .p.channel_layouts = aac_channel_layout, #endif .p.ch_layouts= aac_ch_layout, +.p.priv_class= &aac_decoder_class, .p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), .flush = flush, }; -- 2.37.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 2/2] avcodec/aacdec_fixed: also clip samples on the second channel for stereo HE-AAC
Fixes outputting silence on the second channel when decoding Parametic Stereo HE-AAC. Closes ticekt #3361. Signed-off-by: James Almer --- libavcodec/aacdec_template.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c index 4266d89c6d..cec0e4eb2f 100644 --- a/libavcodec/aacdec_template.c +++ b/libavcodec/aacdec_template.c @@ -3095,7 +3095,8 @@ static void spectral_to_sample(AACContext *ac, int samples) /* preparation for resampler */ for(j = 0; jch[0].ret[j] = (int32_t)av_clip64((int64_t)che->ch[0].ret[j]*128, INT32_MIN, INT32_MAX-0x8000)+0x8000; -if(type == TYPE_CPE) +if(type == TYPE_CPE || + (type == TYPE_SCE && ac->oc[1].m4ac.ps == 1)) che->ch[1].ret[j] = (int32_t)av_clip64((int64_t)che->ch[1].ret[j]*128, INT32_MIN, INT32_MAX-0x8000)+0x8000; } } -- 2.37.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avcodec/alac: don't fail if channels aren't set during init() when extradata is valid
On 7/30/2022 7:40 AM, Jean-Baptiste Kempf wrote: On Sat, 30 Jul 2022, at 11:41, Jan Ekström wrote: Had the person doing API client usage who reported this to me test the patch, it fixes the issue. LGTM. Would probably be worth it to back-port this to release/5.1 . I agree. Applied and backported, thanks. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH v2] avformat/mxfdec: SMPTE RDD 48:2018 Amd 1:2022 support
Signed-off-by: Michael Niedermayer --- libavformat/mxf.c| 3 +++ libavformat/mxf.h| 1 + libavformat/mxfdec.c | 48 3 files changed, 52 insertions(+) diff --git a/libavformat/mxf.c b/libavformat/mxf.c index 36d662b58c..8ef928b8fc 100644 --- a/libavformat/mxf.c +++ b/libavformat/mxf.c @@ -66,6 +66,9 @@ const MXFCodecUL ff_mxf_codec_uls[] = { { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x01,0x01,0x02,0x02,0x01 }, 16, AV_CODEC_ID_V210 }, /* V210 */ { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0E,0x04,0x02,0x01,0x02,0x11,0x00,0x00 }, 14, AV_CODEC_ID_PRORES }, /* Avid MC7 ProRes */ { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0D,0x04,0x01,0x02,0x02,0x03,0x06,0x00,0x00 }, 14, AV_CODEC_ID_PRORES }, /* Apple ProRes */ +{ { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0D,0x04,0x01,0x02,0x02,0x03,0x09,0x01,0x00 }, 15, AV_CODEC_ID_FFV1 }, /*FFV1 V0 */ +{ { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0D,0x04,0x01,0x02,0x02,0x03,0x09,0x02,0x00 }, 15, AV_CODEC_ID_FFV1 }, /*FFV1 V1 */ +{ { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0D,0x04,0x01,0x02,0x02,0x03,0x09,0x04,0x00 }, 15, AV_CODEC_ID_FFV1 }, /*FFV1 V3 */ /* SoundEssenceCompression */ { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x03,0x04,0x02,0x02,0x02,0x03,0x03,0x01,0x00 }, 14,AV_CODEC_ID_AAC }, /* MPEG-2 AAC ADTS (legacy) */ { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x04,0x02,0x02,0x01,0x00,0x00,0x00,0x00 }, 13, AV_CODEC_ID_PCM_S16LE }, /* uncompressed */ diff --git a/libavformat/mxf.h b/libavformat/mxf.h index 4d9f5119a3..2561605ce5 100644 --- a/libavformat/mxf.h +++ b/libavformat/mxf.h @@ -54,6 +54,7 @@ enum MXFMetadataSetType { AudioChannelLabelSubDescriptor, SoundfieldGroupLabelSubDescriptor, GroupOfSoundfieldGroupsLabelSubDescriptor, +FFV1SubDescriptor, }; enum MXFFrameLayout { diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 400941c348..feebff67aa 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -237,6 +237,12 @@ typedef struct MXFMCASubDescriptor { char *language; } MXFMCASubDescriptor; +typedef struct MXFFFV1SubDescriptor { +MXFMetadataSet meta; +uint8_t *extradata; +int extradata_size; +} MXFFFV1SubDescriptor; + typedef struct MXFIndexTableSegment { MXFMetadataSet meta; int edit_unit_byte_count; @@ -337,6 +343,7 @@ static const uint8_t mxf_crypto_source_container_ul[] = { 0x06,0x0e,0x2b,0x static const uint8_t mxf_encrypted_triplet_key[] = { 0x06,0x0e,0x2b,0x34,0x02,0x04,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x7e,0x01,0x00 }; static const uint8_t mxf_encrypted_essence_container[] = { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x0b,0x01,0x00 }; static const uint8_t mxf_sony_mpeg4_extradata[]= { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0e,0x06,0x06,0x02,0x02,0x01,0x00,0x00 }; +static const uint8_t mxf_ffv1_extradata[] = { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x0e,0x04,0x01,0x06,0x0c,0x01,0x00,0x00,0x00 }; // FFV1InitializationMetadata static const uint8_t mxf_avid_project_name[] = { 0xa5,0xfb,0x7b,0x25,0xf6,0x15,0x94,0xb9,0x62,0xfc,0x37,0x17,0x49,0x2d,0x42,0xbf }; static const uint8_t mxf_jp2k_rsiz[] = { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x0a,0x04,0x01,0x06,0x03,0x01,0x00,0x00,0x00 }; static const uint8_t mxf_indirect_value_utf16le[] = { 0x4c,0x00,0x02,0x10,0x01,0x00,0x00,0x00,0x00,0x06,0x0e,0x2b,0x34,0x01,0x04,0x01,0x01 }; @@ -377,6 +384,9 @@ static void mxf_free_metadataset(MXFMetadataSet **ctx, int freectx) av_freep(&((MXFDescriptor *)*ctx)->file_descriptors_refs); av_freep(&((MXFDescriptor *)*ctx)->sub_descriptors_refs); break; +case FFV1SubDescriptor: +av_freep(&((MXFFFV1SubDescriptor *)*ctx)->extradata); +break; case AudioChannelLabelSubDescriptor: case SoundfieldGroupLabelSubDescriptor: case GroupOfSoundfieldGroupsLabelSubDescriptor: @@ -1473,6 +1483,25 @@ static int mxf_read_mca_sub_descriptor(void *arg, AVIOContext *pb, int tag, int return 0; } +static int mxf_read_ffv1_sub_descriptor(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset) +{ +MXFFFV1SubDescriptor *ffv1_sub_descriptor = arg; + +if (IS_KLV_KEY(uid, mxf_ffv1_extradata) && size <= INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE ) { +if (ffv1_sub_descriptor->extradata) +av_log(NULL, AV_LOG_WARNING, "Duplicate ffv1_extradata\n"); +av_free(ffv1_sub_descriptor->extradata); +ffv1_sub_descriptor->extradata_size = 0; +ffv1_sub_descriptor->extradata = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE); +if (!ffv1_sub_descriptor->extradata) +return AVERROR(ENOMEM); +ffv1_sub_descriptor->extradata_size = size; +avio_read(pb, ffv1_sub_descriptor->extradata, size); +}
Re: [FFmpeg-devel] [PATCH 34/39] avcodec/mpegvideoencdsp: Allow pointers to const where possible
On Sat, Jul 30, 2022 at 11:55:45AM +0200, Andreas Rheinhardt wrote: > Michael Niedermayer: > > On Wed, Jul 27, 2022 at 12:08:09AM +0200, Andreas Rheinhardt wrote: > >> Signed-off-by: Andreas Rheinhardt > >> --- > >> libavcodec/arm/mpegvideoencdsp_init_arm.c | 4 ++-- > >> libavcodec/mips/h263dsp_mips.h | 2 +- > >> libavcodec/mips/mpegvideoencdsp_msa.c | 4 ++-- > >> libavcodec/mpegvideoencdsp.c | 10 +- > >> libavcodec/mpegvideoencdsp.h | 10 +- > >> libavcodec/ppc/mpegvideoencdsp.c | 8 > >> libavcodec/x86/mpegvideoenc_qns_template.c | 4 ++-- > >> libavcodec/x86/mpegvideoencdsp.asm | 4 ++-- > >> libavcodec/x86/mpegvideoencdsp_init.c | 6 +++--- > >> 9 files changed, 26 insertions(+), 26 deletions(-) > > > > LGTM, also all similar things should be ok > > > > [...] > > > > Unfortunately, it is not so easy. The first version of this patchset > (this here) forgot to update the definitions of several loongarch > functions, leading to lots of red on patchwork. The second version fixed > the compilation error, but forgot some constifications due to > unfortunate oversights. For the third version, I wanted to actually > compile loongarch instead of just staring at the code; but the > GCC-cross-compiler does not seem to support lsx and lasx (and looking at > the loongarch-code in GCC makes me believe that they are just not > supported (yet)). Therefore I resorted to creating dummy-functions for > all the __lasx_* and __lsx_* functions (they show no more > const-warnings). I wanted to let the FATE-loongarch-box test this once > more (and tell me whether there are still any issues left), yet this box > is no longer active since a few days (for reasons unknown). Can you > compile the lsx and lasx code (after all, you committed all the > loongarch code)? i have no easy way to test loongarch, what i can test is qemu-mips. i think i have said that a few times already. I do have a loongson box that is IIRC ready to be shipped (within EU) to whoever volunteers to maintain that box for FFmpeg. I dont know if that box would help with the current code. The OS will liklely need to be updated and IIRC this has no normal update mechanism) I didnt touch this box for a really long time. I apply loongarch patches when they are reviewed and approved by the loongson maintainers. I do test that they do not break qemu-mips and give them a quick look also so they dont contains obvious mistakes like changing non mips things about patchwork, please talk with Andriy. If you want to help maintain patchwork and or look into that yourself, again talk with Andriy. Also paul on IRC said Andriy left ffmpeg, i havent heared anything from Andriy in that direction. So this may be a joke from paul i do not know thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 1/2] avformat/mov: fix frag_index.current out of sync
From: Zhao Zhili frag_index.current is used by cenc_filter, and is updated inside mov_read_moof. It can out of sync regarding to mov_read_packet. Partly fix ticket #9807. --- libavformat/mov.c | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index a09a762d91..ce12a9e4f1 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -7095,6 +7095,31 @@ static int cenc_decrypt(MOVContext *c, MOVStreamContext *sc, AVEncryptionInfo *s } } +static MOVFragmentStreamInfo *get_frag_stream_info_from_pkt(MOVFragmentIndex *frag_index, AVPacket *pkt, int id) +{ +int current = frag_index->current; + +if (!frag_index->nb_items) +return NULL; + +// Check frag_index->current is the right one for pkt. It can out of sync. +if (current >= 0 && current < frag_index->nb_items) { +if (frag_index->item[current].moof_offset < pkt->pos && +(current + 1 == frag_index->nb_items || + frag_index->item[current + 1].moof_offset > pkt->pos)) +return get_frag_stream_info(frag_index, current, id); +} + + +for (int i = 0; i < frag_index->nb_items; i++) { +if (frag_index->item[i].moof_offset > pkt->pos) +break; +current = i; +} +frag_index->current = current; +return get_frag_stream_info(frag_index, current, id); +} + static int cenc_filter(MOVContext *mov, AVStream* st, MOVStreamContext *sc, AVPacket *pkt, int current_index) { MOVFragmentStreamInfo *frag_stream_info; @@ -7102,7 +7127,7 @@ static int cenc_filter(MOVContext *mov, AVStream* st, MOVStreamContext *sc, AVPa AVEncryptionInfo *encrypted_sample; int encrypted_index, ret; -frag_stream_info = get_frag_stream_info(&mov->frag_index, mov->frag_index.current, st->id); +frag_stream_info = get_frag_stream_info_from_pkt(&mov->frag_index, pkt, st->id); encrypted_index = current_index; encryption_index = NULL; if (frag_stream_info) { -- 2.34.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 2/2] avformat/mov: fix encryption index in the case of multiple trun
From: Zhao Zhili frag_stream_info->index_entry isn't the first sample/trun index. cenc.frag_index_entry_base failed to catch the case since current_index > 0. Fix ticket #9807. --- libavformat/isom.h | 3 ++- libavformat/mov.c | 10 ++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/libavformat/isom.h b/libavformat/isom.h index f05c2d9c28..c6365f2f48 100644 --- a/libavformat/isom.h +++ b/libavformat/isom.h @@ -135,6 +135,8 @@ typedef struct MOVFragmentStreamInfo { int64_t first_tfra_pts; int64_t tfdt_dts; int64_t next_trun_dts; +// Index of the first sample/trun in the fragment. +int index_base; int index_entry; MOVEncryptionIndex *encryption_index; } MOVFragmentStreamInfo; @@ -253,7 +255,6 @@ typedef struct MOVStreamContext { struct { struct AVAESCTR* aes_ctr; struct AVAES *aes_ctx; -unsigned int frag_index_entry_base; unsigned int per_sample_iv_size; // Either 0, 8, or 16. AVEncryptionInfo *default_encrypted_sample; MOVEncryptionIndex *encryption_index; diff --git a/libavformat/mov.c b/libavformat/mov.c index ce12a9e4f1..23d9bb4af1 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1369,6 +1369,7 @@ static int update_frag_index(MOVContext *c, int64_t offset) frag_stream_info[i].tfdt_dts = AV_NOPTS_VALUE; frag_stream_info[i].next_trun_dts = AV_NOPTS_VALUE; frag_stream_info[i].first_tfra_pts = AV_NOPTS_VALUE; +frag_stream_info[i].index_base = -1; frag_stream_info[i].index_entry = -1; frag_stream_info[i].encryption_index = NULL; } @@ -5125,8 +5126,11 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom) sc->ctts_count = sti->nb_index_entries; // Record the index_entry position in frag_index of this fragment -if (frag_stream_info) +if (frag_stream_info) { frag_stream_info->index_entry = index_entry_pos; +if (frag_stream_info->index_base < 0) +frag_stream_info->index_base = index_entry_pos; +} if (index_entry_pos > 0) prev_dts = sti->index_entries[index_entry_pos-1].timestamp; @@ -7134,9 +7138,7 @@ static int cenc_filter(MOVContext *mov, AVStream* st, MOVStreamContext *sc, AVPa // Note this only supports encryption info in the first sample descriptor. if (mov->fragment.stsd_id == 1) { if (frag_stream_info->encryption_index) { -if (!current_index && frag_stream_info->index_entry) -sc->cenc.frag_index_entry_base = frag_stream_info->index_entry; -encrypted_index = current_index - (frag_stream_info->index_entry - sc->cenc.frag_index_entry_base); +encrypted_index = current_index - frag_stream_info->index_base; encryption_index = frag_stream_info->encryption_index; } else { encryption_index = sc->cenc.encryption_index; -- 2.34.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 1/2] avfilter/vf_cropdetect: Remove set-but-unused variable
Signed-off-by: Andreas Rheinhardt --- Will apply this patchset soon. libavfilter/vf_cropdetect.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c index eec0c7ab68..7e985fb271 100644 --- a/libavfilter/vf_cropdetect.c +++ b/libavfilter/vf_cropdetect.c @@ -204,7 +204,6 @@ static int config_input(AVFilterLink *inlink) CropDetectContext *s = ctx->priv; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); const int bufsize = inlink->w * inlink->h; -int bpp; av_image_fill_max_pixsteps(s->max_pixsteps, NULL, desc); @@ -216,7 +215,6 @@ static int config_input(AVFilterLink *inlink) s->x2 = 0; s->y2 = 0; -bpp= s->max_pixsteps[0]; s->window_size = FFMAX(s->reset_count, 15); s->tmpbuf = av_malloc(bufsize); s->filterbuf = av_malloc(bufsize * s->max_pixsteps[0]); -- 2.34.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 2/2] tests/ref/fate/filter-metadata-cropdetect[12]: Fix ref file
Necessitated by 6ca43a9675d651d7ea47c7ba2fafb1bf831c4d0b and 425b309fa43236f4b7c098c7829b70a421fc1dd7. Signed-off-by: Andreas Rheinhardt --- Did someone ever look why 6ca43a9675d651d7ea47c7ba2fafb1bf831c4d0b made these changes? tests/ref/fate/filter-metadata-cropdetect1 | 20 +++- tests/ref/fate/filter-metadata-cropdetect2 | 21 - 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/tests/ref/fate/filter-metadata-cropdetect1 b/tests/ref/fate/filter-metadata-cropdetect1 index 892373cc11..78fbefd85a 100644 --- a/tests/ref/fate/filter-metadata-cropdetect1 +++ b/tests/ref/fate/filter-metadata-cropdetect1 @@ -1,9 +1,11 @@ -pts=0 -pts=1001 -pts=2002|tag:lavfi.cropdetect.x1=20|tag:lavfi.cropdetect.x2=851|tag:lavfi.cropdetect.y1=311|tag:lavfi.cropdetect.y2=601|tag:lavfi.cropdetect.w=832|tag:lavfi.cropdetect.h=288|tag:lavfi.cropdetect.x=20|tag:lavfi.cropdetect.y=314 -pts=3003|tag:lavfi.cropdetect.x1=20|tag:lavfi.cropdetect.x2=885|tag:lavfi.cropdetect.y1=311|tag:lavfi.cropdetect.y2=621|tag:lavfi.cropdetect.w=864|tag:lavfi.cropdetect.h=304|tag:lavfi.cropdetect.x=22|tag:lavfi.cropdetect.y=316 -pts=4004|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=885|tag:lavfi.cropdetect.y1=115|tag:lavfi.cropdetect.y2=621|tag:lavfi.cropdetect.w=880|tag:lavfi.cropdetect.h=496|tag:lavfi.cropdetect.x=4|tag:lavfi.cropdetect.y=122 -pts=5005|tag:lavfi.cropdetect.x1=20|tag:lavfi.cropdetect.x2=885|tag:lavfi.cropdetect.y1=311|tag:lavfi.cropdetect.y2=621|tag:lavfi.cropdetect.w=864|tag:lavfi.cropdetect.h=304|tag:lavfi.cropdetect.x=22|tag:lavfi.cropdetect.y=316 -pts=6006|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=885|tag:lavfi.cropdetect.y1=115|tag:lavfi.cropdetect.y2=621|tag:lavfi.cropdetect.w=880|tag:lavfi.cropdetect.h=496|tag:lavfi.cropdetect.x=4|tag:lavfi.cropdetect.y=122 -pts=7007|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=885|tag:lavfi.cropdetect.y1=115|tag:lavfi.cropdetect.y2=621|tag:lavfi.cropdetect.w=880|tag:lavfi.cropdetect.h=496|tag:lavfi.cropdetect.x=4|tag:lavfi.cropdetect.y=122 -pts=8008|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=885|tag:lavfi.cropdetect.y1=115|tag:lavfi.cropdetect.y2=621|tag:lavfi.cropdetect.w=880|tag:lavfi.cropdetect.h=496|tag:lavfi.cropdetect.x=4|tag:lavfi.cropdetect.y=122 +pts=0| + +pts=1001| + +pts=2002|tag:lavfi.cropdetect.x=20|tag:lavfi.cropdetect.x1=20|tag:lavfi.cropdetect.x2=851|tag:lavfi.cropdetect.y1=311|tag:lavfi.cropdetect.y2=601|tag:lavfi.cropdetect.w=832|tag:lavfi.cropdetect.h=288|tag:lavfi.cropdetect.y=314| +pts=3003|tag:lavfi.cropdetect.x=22|tag:lavfi.cropdetect.x1=20|tag:lavfi.cropdetect.x2=885|tag:lavfi.cropdetect.y1=311|tag:lavfi.cropdetect.y2=621|tag:lavfi.cropdetect.w=864|tag:lavfi.cropdetect.h=304|tag:lavfi.cropdetect.y=316| +pts=4004|tag:lavfi.cropdetect.x=4|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=885|tag:lavfi.cropdetect.y1=115|tag:lavfi.cropdetect.y2=621|tag:lavfi.cropdetect.w=880|tag:lavfi.cropdetect.h=496|tag:lavfi.cropdetect.y=122| +pts=5005|tag:lavfi.cropdetect.x=22|tag:lavfi.cropdetect.x1=20|tag:lavfi.cropdetect.x2=885|tag:lavfi.cropdetect.y1=311|tag:lavfi.cropdetect.y2=621|tag:lavfi.cropdetect.w=864|tag:lavfi.cropdetect.h=304|tag:lavfi.cropdetect.y=316| +pts=6006|tag:lavfi.cropdetect.x=4|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=885|tag:lavfi.cropdetect.y1=115|tag:lavfi.cropdetect.y2=621|tag:lavfi.cropdetect.w=880|tag:lavfi.cropdetect.h=496|tag:lavfi.cropdetect.y=122| +pts=7007|tag:lavfi.cropdetect.x=4|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=885|tag:lavfi.cropdetect.y1=115|tag:lavfi.cropdetect.y2=621|tag:lavfi.cropdetect.w=880|tag:lavfi.cropdetect.h=496|tag:lavfi.cropdetect.y=122| +pts=8008|tag:lavfi.cropdetect.x=4|tag:lavfi.cropdetect.x1=0|tag:lavfi.cropdetect.x2=885|tag:lavfi.cropdetect.y1=115|tag:lavfi.cropdetect.y2=621|tag:lavfi.cropdetect.w=880|tag:lavfi.cropdetect.h=496|tag:lavfi.cropdetect.y=122| diff --git a/tests/ref/fate/filter-metadata-cropdetect2 b/tests/ref/fate/filter-metadata-cropdetect2 index 1a628620ef..e58f00770d 100644 --- a/tests/ref/fate/filter-metadata-cropdetect2 +++ b/tests/ref/fate/filter-metadata-cropdetect2 @@ -1,9 +1,12 @@ -pts=0 -pts=512 -pts=1024|tag:lavfi.cropdetect.x1=21|tag:lavfi.cropdetect.x2=1221|tag:lavfi.cropdetect.y1=15|tag:lavfi.cropdetect.y2=1116|tag:lavfi.cropdetect.w=1200|tag:lavfi.cropdetect.h=1088|tag:lavfi.cropdetect.x=22|tag:lavfi.cropdetect.y=22 -pts=1536|tag:lavfi.cropdetect.x1=21|tag:lavfi.cropdetect.x2=1257|tag:lavfi.cropdetect.y1=15|tag:lavfi.cropdetect.y2=1116|tag:lavfi.cropdetect.w=1232|tag:lavfi.cropdetect.h=1088|tag:lavfi.cropdetect.x=24|tag:lavfi.cropdetect.y=22 -pts=2048|tag:lavfi.cropdetect.x1=21|tag:lavfi.cropdetect.x2=1221|tag:lavfi.cropdetect.y1=15|tag:lavfi.cropdetect.y2=1116|tag:lavfi.cropdetect.w=1200|tag:lavfi.cropdetect.h=1088|tag:lavfi.cropdetect.x=22|tag:lavfi.cropdetect.y=22 -pts=2560|tag:lavfi.cropdetect.x1=21|tag:lavfi.cropdetect.x2=1221|tag:lavfi.cropdetect.y1=15|tag:lavfi.cropdetect.y2=1116|tag:lavfi.cropdet
Re: [FFmpeg-devel] [PATCH 1/2] avfilter/vf_cropdetect: Remove set-but-unused variable
On Sat, 30 Jul 2022, Andreas Rheinhardt wrote: Signed-off-by: Andreas Rheinhardt --- Will apply this patchset soon. Thanks - please do! // Martin ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 2/2] tests/ref/fate/filter-metadata-cropdetect[12]: Fix ref file
On 7/30/2022 5:25 PM, Andreas Rheinhardt wrote: Necessitated by 6ca43a9675d651d7ea47c7ba2fafb1bf831c4d0b and 425b309fa43236f4b7c098c7829b70a421fc1dd7. Signed-off-by: Andreas Rheinhardt --- Did someone ever look why 6ca43a9675d651d7ea47c7ba2fafb1bf831c4d0b made these changes? My guess (because i only gave the code a cursory look) is that, since we're now passing the frame as generated by lavfi through untouched, what might have been empty frame metadata tags that av_packet_pack_dictionary() was skipping when copying them to the packet are now reflected (Or maybe av_packet_unpack_dictionary() is what was skipping them from the raw data buffer when decoding the packet). ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 1/2] avformat/mov: fix frag_index.current out of sync
Zhao Zhili 于2022年7月31日 周日01:15写道: > From: Zhao Zhili > > frag_index.current is used by cenc_filter, and is updated inside > mov_read_moof. It can out of sync regarding to mov_read_packet. > > Partly fix ticket #9807. > --- > libavformat/mov.c | 27 ++- > 1 file changed, 26 insertions(+), 1 deletion(-) > > diff --git a/libavformat/mov.c b/libavformat/mov.c > index a09a762d91..ce12a9e4f1 100644 > --- a/libavformat/mov.c > +++ b/libavformat/mov.c > @@ -7095,6 +7095,31 @@ static int cenc_decrypt(MOVContext *c, > MOVStreamContext *sc, AVEncryptionInfo *s > } > } > > +static MOVFragmentStreamInfo > *get_frag_stream_info_from_pkt(MOVFragmentIndex *frag_index, AVPacket *pkt, > int id) > +{ > +int current = frag_index->current; > + > +if (!frag_index->nb_items) > +return NULL; > + > +// Check frag_index->current is the right one for pkt. It can out of > sync. > +if (current >= 0 && current < frag_index->nb_items) { > +if (frag_index->item[current].moof_offset < pkt->pos && > +(current + 1 == frag_index->nb_items || > + frag_index->item[current + 1].moof_offset > pkt->pos)) > +return get_frag_stream_info(frag_index, current, id); > +} > + > + > +for (int i = 0; i < frag_index->nb_items; i++) { > +if (frag_index->item[i].moof_offset > pkt->pos) > +break; > +current = i; > +} > +frag_index->current = current; > +return get_frag_stream_info(frag_index, current, id); > +} > + > static int cenc_filter(MOVContext *mov, AVStream* st, MOVStreamContext > *sc, AVPacket *pkt, int current_index) > { > MOVFragmentStreamInfo *frag_stream_info; > @@ -7102,7 +7127,7 @@ static int cenc_filter(MOVContext *mov, AVStream* > st, MOVStreamContext *sc, AVPa > AVEncryptionInfo *encrypted_sample; > int encrypted_index, ret; > > -frag_stream_info = get_frag_stream_info(&mov->frag_index, > mov->frag_index.current, st->id); > +frag_stream_info = get_frag_stream_info_from_pkt(&mov->frag_index, > pkt, st->id); > encrypted_index = current_index; > encryption_index = NULL; > if (frag_stream_info) { > -- > 2.34.1 > https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=7071 What about this patch to fix this ticket? > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avformat/mov: get the correct fragment stream info when decrypting the sample
OK, I didn't see this one before working on ticket #9807. Comments inline. On 2022-07-22, 1035567130 wrote: >From: Wang Yaqiang > > When using mov_read_packet get a pkt, and the packet is encrypted, > it will invoke the cenc_filter func for process the decryption. > This function find the frag_stream_info according to frag_index.current, > but the value of frag_index.current is equal to the last read index of moof > box, > this will cause pkt and frag_stream_info mismatch > > Signed-off-by: Wang Yaqiang > --- > libavformat/isom.h | 2 ++ > libavformat/mov.c | 33 ++--- > 2 files changed, 28 insertions(+), 7 deletions(-) > > diff --git a/libavformat/isom.h b/libavformat/isom.h > index f05c2d9c28..d90e16457b 100644 > --- a/libavformat/isom.h > +++ b/libavformat/isom.h > @@ -137,6 +137,8 @@ typedef struct MOVFragmentStreamInfo { > int64_t next_trun_dts; > int index_entry; > MOVEncryptionIndex *encryption_index; > +int stsd_id; // current fragment stsd_id > +int64_t max_pos; //current fragment max pos > } MOVFragmentStreamInfo; > typedef struct MOVFragmentIndexItem { > diff --git a/libavformat/mov.c b/libavformat/mov.c > index a09a762d91..c118072931 100644 > --- a/libavformat/mov.c > +++ b/libavformat/mov.c > @@ -1182,6 +1182,20 @@ static int mov_read_moov(MOVContext *c, AVIOContext > *pb, MOVAtom atom) > return 0; /* now go for mdat */ > } > +static int get_frag_index_with_pkt(MOVFragmentIndex *frag_index, AVPacket > *pkt) > +{ > +if (!pkt) return -1; > +for (int i = 0; i < frag_index->nb_items;i++) { > +MOVFragmentStreamInfo *frag_stream_info = > frag_index->item[i].stream_info; > +if (frag_stream_info) { > +if (pkt->pos + pkt->size <= frag_stream_info->max_pos) { > +return i; > +} Coding style: no curly braces in this case. > +} > +} The search is inefficient. Use 'current' as a bookmark. > +return -1; > +} > + > static MOVFragmentStreamInfo * get_frag_stream_info( > MOVFragmentIndex *frag_index, > int index, > @@ -4868,9 +4882,10 @@ static int mov_read_tfhd(MOVContext *c, AVIOContext > *pb, MOVAtom atom) > av_log(c->fc, AV_LOG_TRACE, "frag flags 0x%x\n", frag->flags); > frag_stream_info = get_current_frag_stream_info(&c->frag_index); > -if (frag_stream_info) > +if (frag_stream_info) { > frag_stream_info->next_trun_dts = AV_NOPTS_VALUE; > - > +frag_stream_info->stsd_id = frag->stsd_id; > +} > return 0; > } > @@ -5335,9 +5350,10 @@ static int mov_read_sidx(MOVContext *c, AVIOContext > *pb, MOVAtom atom) > index = update_frag_index(c, offset); > frag_stream_info = get_frag_stream_info(&c->frag_index, index, > track_id); > -if (frag_stream_info) > +if (frag_stream_info) { > frag_stream_info->sidx_pts = timestamp; > - > +frag_stream_info->max_pos = offset + size; Now it depends on sidx, which may not exist. So it doesn't work reliable. > +} > if (av_sat_add64(offset, size) != offset + (uint64_t)size || > av_sat_add64(pts, duration) != pts + (uint64_t)duration > ) > @@ -7101,13 +7117,16 @@ static int cenc_filter(MOVContext *mov, AVStream* st, > MOVStreamContext *sc, AVPa > MOVEncryptionIndex *encryption_index; > AVEncryptionInfo *encrypted_sample; > int encrypted_index, ret; > - > -frag_stream_info = get_frag_stream_info(&mov->frag_index, > mov->frag_index.current, st->id); > +int frag_index = get_frag_index_with_pkt(&mov->frag_index,pkt); > +if (frag_index < 0) { > +frag_index = mov->frag_index.current; > +} Search should be reliable. Use an unreliable search and fallback to another unreliable bookmark is still unrealiable. > +frag_stream_info = get_frag_stream_info(&mov->frag_index,frag_index, > st->id); > encrypted_index = current_index; > encryption_index = NULL; > if (frag_stream_info) { > // Note this only supports encryption info in the first sample > descriptor. > -if (mov->fragment.stsd_id == 1) { > +if (frag_stream_info->stsd_id == 1) { Good catch! It should go in a separate patch. > if (frag_stream_info->encryption_index) { > if (!current_index && frag_stream_info->index_entry) > sc->cenc.frag_index_entry_base = > frag_stream_info->index_entry; > -- > 2.33.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH] avcodec/ttmlenc: Use string literal macro for default namespacing
Fixes -Werror=format-security build failures when building with disabled optimizations and (according to fate.ffmpeg.org also with several other old GCC versions). Signed-off-by: Andreas Rheinhardt --- Will apply this soon to unbreak FATE. libavcodec/ttmlenc.c | 2 +- libavcodec/ttmlenc.h | 10 +- libavformat/ttmlenc.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libavcodec/ttmlenc.c b/libavcodec/ttmlenc.c index 2a0be99028..7a09c8fb5e 100644 --- a/libavcodec/ttmlenc.c +++ b/libavcodec/ttmlenc.c @@ -315,7 +315,7 @@ static int ttml_write_header_content(AVCodecContext *avctx) } // write the first string in extradata, attributes in the base "tt" element. -av_bprintf(&s->buffer, ttml_default_namespacing); +av_bprintf(&s->buffer, TTML_DEFAULT_NAMESPACING); // the cell resolution is in character cells, so not exactly 1:1 against // a pixel based resolution, but as the tts:extent in the root // "tt" element is frowned upon (and disallowed in the EBU-TT profile), diff --git a/libavcodec/ttmlenc.h b/libavcodec/ttmlenc.h index 654ca0ee4d..cbed6f63b3 100644 --- a/libavcodec/ttmlenc.h +++ b/libavcodec/ttmlenc.h @@ -25,10 +25,10 @@ #define TTMLENC_EXTRADATA_SIGNATURE "lavc-ttmlenc" #define TTMLENC_EXTRADATA_SIGNATURE_SIZE (sizeof(TTMLENC_EXTRADATA_SIGNATURE) - 1) -static const char *const ttml_default_namespacing = -" xmlns=\"http://www.w3.org/ns/ttml\"\n"; -" xmlns:ttm=\"http://www.w3.org/ns/ttml#metadata\"\n"; -" xmlns:tts=\"http://www.w3.org/ns/ttml#styling\"\n"; -" xmlns:ttp=\"http://www.w3.org/ns/ttml#parameter\"\n";; +#define TTML_DEFAULT_NAMESPACING\ +" xmlns=\"http://www.w3.org/ns/ttml\"\n"; \ +" xmlns:ttm=\"http://www.w3.org/ns/ttml#metadata\"\n"; \ +" xmlns:tts=\"http://www.w3.org/ns/ttml#styling\"\n"; \ +" xmlns:ttp=\"http://www.w3.org/ns/ttml#parameter\"\n"; #endif /* AVCODEC_TTMLENC_H */ diff --git a/libavformat/ttmlenc.c b/libavformat/ttmlenc.c index 896fc81958..fc8069f7b5 100644 --- a/libavformat/ttmlenc.c +++ b/libavformat/ttmlenc.c @@ -91,7 +91,7 @@ static int ttml_set_header_values_from_extradata( if (!additional_data_size) { // simple case, we don't have to go through local_params and just // set default fall-back values (for old extradata format). -header_params->tt_element_params = ttml_default_namespacing; +header_params->tt_element_params = TTML_DEFAULT_NAMESPACING; header_params->pre_body_elements = ""; return 0; -- 2.34.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 1/2] avcodec/alpha/me_cmp_alpha: Use proper me_cmp_func type
ea41e6d6373063c3a2a9bf48ce8e1c2e6340b694 forgot the int->ptrdiff_t switch for the stride. Libav didn't do it because Libav had already dropped support for Alpha at that point. Only compilation has been tested for this commit. (It might be that the ASM-versions of me_cmp_func functions need to be updated as well.) Signed-off-by: Andreas Rheinhardt --- libavcodec/alpha/me_cmp_alpha.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/libavcodec/alpha/me_cmp_alpha.c b/libavcodec/alpha/me_cmp_alpha.c index 4e9e0f88dc..d5a78f1247 100644 --- a/libavcodec/alpha/me_cmp_alpha.c +++ b/libavcodec/alpha/me_cmp_alpha.c @@ -23,7 +23,8 @@ #include "libavcodec/me_cmp.h" #include "asm.h" -int pix_abs16x16_mvi_asm(void *v, const uint8_t *pix1, const uint8_t *pix2, int line_size, int h); +int pix_abs16x16_mvi_asm(struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, + ptrdiff_t line_size, int h); static inline uint64_t avg2(uint64_t a, uint64_t b) { @@ -44,7 +45,8 @@ static inline uint64_t avg4(uint64_t l1, uint64_t l2, uint64_t l3, uint64_t l4) return r1 + r2; } -static int pix_abs8x8_mvi(void *v, const uint8_t *pix1, const uint8_t *pix2, int line_size, int h) +static int pix_abs8x8_mvi(struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, + ptrdiff_t line_size, int h) { int result = 0; @@ -119,7 +121,8 @@ int pix_abs16x16_mvi(const uint8_t *pix1, const uint8_t *pix2, int line_size) } #endif -static int pix_abs16x16_x2_mvi(void *v, const uint8_t *pix1, const uint8_t *pix2, int line_size, int h) +static int pix_abs16x16_x2_mvi(struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, + ptrdiff_t line_size, int h) { int result = 0; uint64_t disalign = (size_t) pix2 & 0x7; @@ -192,7 +195,8 @@ static int pix_abs16x16_x2_mvi(void *v, const uint8_t *pix1, const uint8_t *pix2 return result; } -static int pix_abs16x16_y2_mvi(void *v, const uint8_t *pix1, const uint8_t *pix2, int line_size, int h) +static int pix_abs16x16_y2_mvi(struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, + ptrdiff_t line_size, int h) { int result = 0; @@ -245,7 +249,8 @@ static int pix_abs16x16_y2_mvi(void *v, const uint8_t *pix1, const uint8_t *pix2 return result; } -static int pix_abs16x16_xy2_mvi(void *v, const uint8_t *pix1, const uint8_t *pix2, int line_size, int h) +static int pix_abs16x16_xy2_mvi(struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, +ptrdiff_t line_size, int h) { int result = 0; -- 2.34.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 2/2] avcodec/alpha/me_cmp_alpha: Remove commented-out function
This function is bitrotten: It uses different parameters than the corresponding ASM functions which replaced it. Signed-off-by: Andreas Rheinhardt --- libavcodec/alpha/me_cmp_alpha.c | 43 - 1 file changed, 43 deletions(-) diff --git a/libavcodec/alpha/me_cmp_alpha.c b/libavcodec/alpha/me_cmp_alpha.c index d5a78f1247..0c1a4a62c5 100644 --- a/libavcodec/alpha/me_cmp_alpha.c +++ b/libavcodec/alpha/me_cmp_alpha.c @@ -78,49 +78,6 @@ static int pix_abs8x8_mvi(struct MpegEncContext *v, const uint8_t *pix1, const u return result; } -#if 0 /* now done in assembly */ -int pix_abs16x16_mvi(const uint8_t *pix1, const uint8_t *pix2, int line_size) -{ -int result = 0; -int h = 16; - -if ((size_t) pix2 & 0x7) { -/* works only when pix2 is actually unaligned */ -do {/* do 16 pixel a time */ -uint64_t p1_l, p1_r, p2_l, p2_r; -uint64_t t; - -p1_l = ldq(pix1); -p1_r = ldq(pix1 + 8); -t = ldq_u(pix2 + 8); -p2_l = extql(ldq_u(pix2), pix2) | extqh(t, pix2); -p2_r = extql(t, pix2) | extqh(ldq_u(pix2 + 16), pix2); -pix1 += line_size; -pix2 += line_size; - -result += perr(p1_l, p2_l) -+ perr(p1_r, p2_r); -} while (--h); -} else { -do { -uint64_t p1_l, p1_r, p2_l, p2_r; - -p1_l = ldq(pix1); -p1_r = ldq(pix1 + 8); -p2_l = ldq(pix2); -p2_r = ldq(pix2 + 8); -pix1 += line_size; -pix2 += line_size; - -result += perr(p1_l, p2_l) -+ perr(p1_r, p2_r); -} while (--h); -} - -return result; -} -#endif - static int pix_abs16x16_x2_mvi(struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t line_size, int h) { -- 2.34.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".