1. 29 Jul, 2019 11 commits
  2. 28 Jul, 2019 5 commits
    • Mark Thompson's avatar
      lavfi: addroi filter · 20fed2f0
      Mark Thompson authored
      This can be used to add region of interest side data to video frames.
      20fed2f0
    • Mark Thompson's avatar
      vaapi_encode: Add ROI support · 33871478
      Mark Thompson authored
      33871478
    • Shiyou Yin's avatar
      avcodec/mips: [loongson] refine process of setting block as 0 in h264dsp_mmi. · 62e6b634
      Shiyou Yin authored
      In function ff_h264_add_pixels4_8_mmi, there is no need to reset '%[ftmp0]'
      to 0, because it's value has never changed since the start of the asm block.
      This patch remove the redundant 'xor' and set src to zero once it was loaded.
      
      In function ff_h264_idct_add_8_mmi, 'block' is seted to zero twice.
      This patch removed the first setting zero operation and move the second one
      after the load operation of block.
      
      In function ff_h264_idct8_add_8_mmi, 'block' is seted to zero twice too.
      This patch just removed the second setting zero operation.
      
      This patch mainly simplifies the implementation of functions above,
      the effect on the performance of whole h264 decoding process is not obvious.
      According to the perf data, proportion of ff_h264_idct_add_8_mmi decreased from
      0.29% to 0.26% and ff_h264_idct8_add_8_mmi decreased from 0.62% to 0.59% when decoding
      H264 format on loongson 3A3000(For reference only , not very stable.).
      Reviewed-by: 's avatarReimar Döffinger <Reimar.Doeffinger@gmx.de>
      Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
      62e6b634
    • Andreas Rheinhardt's avatar
      vp9_metadata: Improve spec-compliance and warnings · abb2e9ac
      Andreas Rheinhardt authored
      The earlier version had three deficits:
      1. It allowed to set the stream to RGB although this is not allowed when
      the profile is 0 or 2.
      2. If it set the stream to RGB, then it did not automatically set the
      range to full range; the result was that one got a warning every time a
      frame with color_config element was processed if the frame originally
      had TV range and the user didn't explicitly choose PC range. Now one
      gets only one warning in such a situation.
      3. Intra-only frames in profile 0 are automatically BT.601, but if the
      user wished another color space, he was not informed about his wishes
      being unfulfillable.
      
      The commit also improves the documentation about this.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      abb2e9ac
    • Andreas Rheinhardt's avatar
      av1/h264_metadata: Don't reinitialize data · 43a18884
      Andreas Rheinhardt authored
      If the relevant elements (the color description elements for AV1 and the
      VUI elements in general for H.264 (since 1156b507)) are absent, then their
      correct values (usually meaning unknown) have already been inferred by
      the reading process, so that it is unnecessary to initialize them again
      in the av1/h264_metadata filters even when they were initially absent.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      43a18884
  3. 27 Jul, 2019 3 commits
    • Andreas Rheinhardt's avatar
      cbs_mpeg2: Fix parsing of picture and slice headers · d9182f04
      Andreas Rheinhardt authored
      1. The extra information in slice headers was parsed incorrectly:
      In the first reading pass to derive the length of the extra information,
      one should look at bits n, n + 9, n + 18, ... and check whether they
      equal one (further extra information) or zero (end of extra information),
      but instead bits n, n + 8, n + 16, ... were inspected. The second pass
      of reading (where the length is already known and the bytes between the
      length-determining bits are copied into a buffer) did not record what
      was in bits n, n + 9, n + 18, ..., presuming they equal one. And during
      writing, the bytes in the buffer are interleaved with set bits and
      written. This means that if the detected length of the extra information
      was greater than the real length, the output was corrupted. Fortunately
      no sample is known that made use of this mechanism: The extra information
      in slices is still marked as reserved in the specifications. cbs_mpeg2
      is now ready in case this changes.
      
      2. Furthermore, the buffer is now padded and slightly different, but
      very similar code for reading resp. writing has been replaced by code
      used for both. This was made possible by a new macro, the equivalent
      to cbs_h2645's fixed().
      
      3. These changes also made it possible to remove the extra_bit_slice
      element from the MPEG2RawSliceHeader structure. Said element was always
      zero except when the detected length of the extra information was less
      than the real length.
      
      4. The extra information in picture headers (which uses essentially the
      same syntax as the extra information in slice headers) has simply been
      forgotten. This meant that if this extra information was present, it was
      discarded during reading; and unfortunately writing created invalid
      bitstreams in this case (an extra_bit_picture - the last set bit of the
      whole unit - indicated that there would be a further byte of data,
      although the output didn't contain said data).
      
      This has been fixed; both types of extra information are now parsed via
      the same code and essentially passed through.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      d9182f04
    • Andreas Rheinhardt's avatar
      cbs: Remove useless initializations · b71a0367
      Andreas Rheinhardt authored
      Up until now, a temporary variable was used and initialized every time a
      value was read in CBS; if reading turned out to be successfull, this
      value was overwritten (without having ever been looked at) with the
      value read if reading was successfull; on failure the variable wasn't
      touched either. Therefore these initializations can be and have been
      removed.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      b71a0367
    • Andreas Rheinhardt's avatar
      mpeg2_metadata, cbs_mpeg2: Fix handling of colour_description · c2a91645
      Andreas Rheinhardt authored
      If a sequence display extension is read with colour_description equal to
      zero, but a user wants to add one or more of the colour_description
      elements, then the colour_description elements the user did not explicitly
      request to be set are set to zero and not to the value equal to
      unknown/unspecified (namely 2). A value of zero is not only inappropriate,
      but explicitly forbidden. This is fixed by inferring the right default
      values during the reading process if the elements are absent; moreover,
      changing any of the colour_description elements to zero is now no longer
      possible.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      c2a91645
  4. 26 Jul, 2019 8 commits
  5. 25 Jul, 2019 1 commit
  6. 24 Jul, 2019 4 commits
  7. 22 Jul, 2019 8 commits
    • Paul B Mahol's avatar
      avfilter/vf_ciescope: add DCI-P3 · 3883c9d1
      Paul B Mahol authored
      3883c9d1
    • Limin Wang's avatar
      avformat/f_select: add support for more pixel formats for scene change score calculations · b696caba
      Limin Wang authored
      This avoids automatic conversions to rgb if scene change score is used in the expression.
      
      Below is the tested results for the new added pixel format without autoscale to rgb24:
      1. AV_PIX_FMT_YUVJ420P
      time ./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact -f lavfi \
      "sws_flags=+accurate_rnd+bitexact;movie=../fate-suite/svq3/Vertical400kbit.sorenson3.mov,select=gt(scene\,.25)"
      
      master:
      pkt_pts=1620|tag:lavfi.scene_score=1.000000
      pkt_pts=4140|tag:lavfi.scene_score=0.875036
      pkt_pts=5800|tag:lavfi.scene_score=1.000000
      pkt_pts=6720|tag:lavfi.scene_score=0.461625
      pkt_pts=8160|tag:lavfi.scene_score=1.000000
      pkt_pts=9760|tag:lavfi.scene_score=1.000000
      pkt_pts=14080|tag:lavfi.scene_score=0.838916
      pkt_pts=15700|tag:lavfi.scene_score=1.000000
      pkt_pts=18500|tag:lavfi.scene_score=0.474948
      pkt_pts=20040|tag:lavfi.scene_score=0.379700
      pkt_pts=21760|tag:lavfi.scene_score=1.000000
      ./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact -f  0.71s user 0.01s system 99% cpu 0.721 total
      
      patch applied:
      pkt_pts=1620|tag:lavfi.scene_score=1.000000
      pkt_pts=4140|tag:lavfi.scene_score=0.668643
      pkt_pts=5800|tag:lavfi.scene_score=0.996721
      pkt_pts=6720|tag:lavfi.scene_score=0.357390
      pkt_pts=8160|tag:lavfi.scene_score=0.886268
      pkt_pts=9760|tag:lavfi.scene_score=0.926219
      pkt_pts=14080|tag:lavfi.scene_score=0.650033
      pkt_pts=15700|tag:lavfi.scene_score=1.000000
      pkt_pts=18500|tag:lavfi.scene_score=0.316402
      pkt_pts=20040|tag:lavfi.scene_score=0.269509
      pkt_pts=21760|tag:lavfi.scene_score=1.000000
      ./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact -f  0.19s user 0.01s system 81% cpu 0.240 total
      
      2. AV_PIX_FMT_YUV420P
      time ./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact -f lavfi \
      "sws_flags=+accurate_rnd+bitexact;movie=../Passengers_Breakfast_1080-sdr.mkv,select=gt(scene\,.2)"
      master:
      pkt_pts=3587|tag:lavfi.scene_score=0.462364
      pkt_pts=4838|tag:lavfi.scene_score=0.419519
      pkt_pts=6548|tag:lavfi.scene_score=0.397027
      pkt_pts=9968|tag:lavfi.scene_score=0.419245
      pkt_pts=12471|tag:lavfi.scene_score=0.413084
      pkt_pts=16225|tag:lavfi.scene_score=0.506370
      pkt_pts=19645|tag:lavfi.scene_score=0.507538
      pkt_pts=22314|tag:lavfi.scene_score=0.504319
      pkt_pts=24817|tag:lavfi.scene_score=0.417544
      pkt_pts=25651|tag:lavfi.scene_score=0.413916
      pkt_pts=26652|tag:lavfi.scene_score=0.487707
      18.58s user 0.07s system 99% cpu 18.663 total
      
      patch applied:
      pkt_pts=3587|tag:lavfi.scene_score=0.272173
      pkt_pts=4838|tag:lavfi.scene_score=0.247841
      pkt_pts=6548|tag:lavfi.scene_score=0.233134
      pkt_pts=9968|tag:lavfi.scene_score=0.247253
      pkt_pts=12471|tag:lavfi.scene_score=0.244129
      pkt_pts=16225|tag:lavfi.scene_score=0.302531
      pkt_pts=19645|tag:lavfi.scene_score=0.303560
      pkt_pts=22314|tag:lavfi.scene_score=0.301861
      pkt_pts=24817|tag:lavfi.scene_score=0.249331
      pkt_pts=25651|tag:lavfi.scene_score=0.247096
      pkt_pts=26652|tag:lavfi.scene_score=0.287728
      10.90s user 0.06s system 99% cpu 10.967 total
      
      3. AV_PIX_FMT_YUV422P
      
      time ./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact -f lavfi \
      "sws_flags=+accurate_rnd+bitexact;movie=../Passengers_Breakfast_1080-sdr.mkv,format=yuv422p,select=gt(scene\,.2)"
      master:
      
      patched applied:
      pkt_pts=3587|tag:lavfi.scene_score=0.224017
      pkt_pts=4838|tag:lavfi.scene_score=0.204225
      pkt_pts=9968|tag:lavfi.scene_score=0.204636
      pkt_pts=12471|tag:lavfi.scene_score=0.202772
      pkt_pts=16225|tag:lavfi.scene_score=0.248765
      pkt_pts=19645|tag:lavfi.scene_score=0.250144
      pkt_pts=22314|tag:lavfi.scene_score=0.248802
      pkt_pts=24817|tag:lavfi.scene_score=0.208362
      pkt_pts=25651|tag:lavfi.scene_score=0.205777
      pkt_pts=26652|tag:lavfi.scene_score=0.230742
      
      4.  AV_PIX_FMT_YUV420P10
      time ./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact -f lavfi \
      "sws_flags=+accurate_rnd+bitexact;movie=../Passengers_Breakfast_4k.mkv,select=gt(scene\,.2)"
      
      master:
      pkt_pts=3587|tag:lavfi.scene_score=0.269890
      pkt_pts=4838|tag:lavfi.scene_score=0.248957
      pkt_pts=6548|tag:lavfi.scene_score=0.234619
      pkt_pts=9969|tag:lavfi.scene_score=0.224912
      pkt_pts=12471|tag:lavfi.scene_score=0.225158
      pkt_pts=16225|tag:lavfi.scene_score=0.289809
      pkt_pts=19645|tag:lavfi.scene_score=0.285013
      pkt_pts=22314|tag:lavfi.scene_score=0.280295
      pkt_pts=24817|tag:lavfi.scene_score=0.206486
      pkt_pts=25651|tag:lavfi.scene_score=0.208556
      pkt_pts=26652|tag:lavfi.scene_score=0.249577
      ./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact -f  76.03s user 0.22s system 99% cpu 1:16.27 total
      
      patch applied
      pkt_pts=3587|tag:lavfi.scene_score=0.269890
      pkt_pts=4838|tag:lavfi.scene_score=0.248957
      pkt_pts=6548|tag:lavfi.scene_score=0.234619
      pkt_pts=9969|tag:lavfi.scene_score=0.224912
      pkt_pts=12471|tag:lavfi.scene_score=0.225158
      pkt_pts=16225|tag:lavfi.scene_score=0.289809
      pkt_pts=19645|tag:lavfi.scene_score=0.285013
      pkt_pts=22314|tag:lavfi.scene_score=0.280295
      pkt_pts=24817|tag:lavfi.scene_score=0.206486
      pkt_pts=25651|tag:lavfi.scene_score=0.208556
      pkt_pts=26652|tag:lavfi.scene_score=0.249577
      ./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact -f  50.27s user 0.20s system 99% cpu 50.476 total
      
      5. AV_PIX_FMT_RGBA, AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA, AV_PIX_FMT_GRAY8
      are tested by format= with the fate sample: Vertical400kbit.sorenson3.mov like below:
      time ./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact -f lavfi \
      "sws_flags=+accurate_rnd+bitexact;movie=../fate-suite/svq3/Vertical400kbit.sorenson3.mov,format=rgba,select=gt(scene\,.25)"
      
      patch applied:
      pkt_pts=1620|tag:lavfi.scene_score=1.000000
      pkt_pts=4140|tag:lavfi.scene_score=0.656277
      pkt_pts=5800|tag:lavfi.scene_score=1.000000
      pkt_pts=6720|tag:lavfi.scene_score=0.346218
      pkt_pts=8160|tag:lavfi.scene_score=0.987686
      pkt_pts=9760|tag:lavfi.scene_score=1.000000
      pkt_pts=14080|tag:lavfi.scene_score=0.629187
      pkt_pts=15700|tag:lavfi.scene_score=1.000000
      pkt_pts=18500|tag:lavfi.scene_score=0.356211
      pkt_pts=20040|tag:lavfi.scene_score=0.284775
      pkt_pts=21760|tag:lavfi.scene_score=1.000000
      
      6. AV_PIX_FMT_YUVJ422P
      time ./ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -bitexact -f lavfi \
      "sws_flags=+accurate_rnd+bitexact;movie=../fate-suite/svq3/Vertical400kbit.sorenson3.mov,format=yuvj422p,select=gt(scene\,.25)"
      
      patch applied:
      pkt_pts=1620|tag:lavfi.scene_score=0.838281
      pkt_pts=4140|tag:lavfi.scene_score=0.541382
      pkt_pts=5800|tag:lavfi.scene_score=0.780588
      pkt_pts=6720|tag:lavfi.scene_score=0.298274
      pkt_pts=8160|tag:lavfi.scene_score=0.699106
      pkt_pts=9760|tag:lavfi.scene_score=0.730136
      pkt_pts=14080|tag:lavfi.scene_score=0.537742
      pkt_pts=15700|tag:lavfi.scene_score=0.811946
      pkt_pts=18500|tag:lavfi.scene_score=0.263382
      pkt_pts=21760|tag:lavfi.scene_score=0.880773
      Reviewed-by: 's avatarMarton Balint <cus@passwd.hu>
      Signed-off-by: 's avatarLimin Wang <lance.lmwang@gmail.com>
      b696caba
    • Limin Wang's avatar
      fate: change the scenecut fate threshold · d75c7dd4
      Limin Wang authored
      why change .4 to .25, it's for:
      one scenecut(pkt_pts=20040) isn't detected by 0.4 threshold
      
      why not change to 0.3 instead of 0.25:
      it will miss the scenecut(pkt_pts=20040) after applying the next
      patch which enables yuvj420
      
      for fate testing, it's better to catch all scenecut scenes.
      Reviewed-by: 's avatarMarton Balint <cus@passwd.hu>
      Signed-off-by: 's avatarLimin Wang <lance.lmwang@gmail.com>
      d75c7dd4
    • Limin Wang's avatar
      avformat/f_select: support scenecut with more pixel formats · 53462cea
      Limin Wang authored
      This patch does not make other pixel formats usable yet to make sure the test
      result is the same with rgb32 format.
      Reviewed-by: 's avatarMarton Balint <cus@passwd.hu>
      Signed-off-by: 's avatarLimin Wang <lance.lmwang@gmail.com>
      53462cea
    • Baptiste Coudurier's avatar
    • Gyan Doshi's avatar
      avformat/mov: fix return code for trun box with no sample entries · d51d71c1
      Gyan Doshi authored
      A value of zero for sample_count in trun box is not
      prohibited by 14496-12 section 8.8.8. 4a9d32ba
      disallowed this which led the demuxer to error out
      when reading the header of valid files.
      d51d71c1
    • Matthieu Bouron's avatar
    • Matthieu Bouron's avatar
      avcodec/mediacodec_wrapper: fix a potential local reference leak in... · 3f232d71
      Matthieu Bouron authored
      avcodec/mediacodec_wrapper: fix a potential local reference leak in ff_AMediaCodec_getCodecNameByType()
      3f232d71