intel / cartwheel-ffmpeg

Intel developer staging area for unmerged upstream patch contributions to FFmpeg
GNU Lesser General Public License v2.1
99 stars 33 forks source link

vaapi_encode_av1: Fix build error C2099: initializer is not a constant #209

Closed sivileri closed 1 year ago

sivileri commented 1 year ago

When https://github.com/intel-media-ci/ffmpeg/pull/619 lands, we'll have ffmpeg/vaapi support on Windows.

A C2099 build error is found when applying https://github.com/intel-media-ci/cartwheel-ffmpeg/blob/master/patches/0071-lavc-vaapi-support-av1-encode.patch . This patch fixes the build issue by replacing the non constant av_log2(64) with a constant value 6 (2^6 = 64).

cc @xuguangxin @xhaihao @feiwan1 @wenbinc-Bin @galinart

uartie commented 1 year ago

Patch fails to apply to submodule

uartie commented 1 year ago

Does this depend on #208?

xhaihao commented 1 year ago

Does this depend on #208?

Seems this doesn't depend on #208.

@sivileri When we submit patches to FFmpeg ML, we should make sure each patch is compilable and runnable. Could you please update the original patch ?

intel-media-ci commented 1 year ago

No updates/response to reviews in last week. Closing to minimize CI resource use. Feel free to reopen when your reviews have been addressed and updates applied.

sivileri commented 1 year ago

@uartie @xhaihao apologies for the delay I just came back to office. Looks like I should update the original patch file https://github.com/intel-media-ci/cartwheel-ffmpeg/blob/master/patches/0071-lavc-vaapi-support-av1-encode.patch like #208 does instead of creating a new patch on top of it, correct?

The way I'm doing it is:

  1. git clone https://github.com/intel/cartwheel-ffmpeg --recursive
  2. cd cartwheel-ffmpeg
  3. git submodule update --init --recursive
  4. cd ffmpeg
  5. git checkout -b fix_msvc_av1_error
  6. git am (dir ..\patches*.patch)
  7. Modify the code with the changes in this PR to avoid the build error

After step (7), previously I created a new local commit and did git show mycommitSHA > patch-file.patch which I posted in this PR.

Could you please advise how to instead generate the changes into directly into https://github.com/intel-media-ci/cartwheel-ffmpeg/blob/master/patches/0071-lavc-vaapi-support-av1-encode.patch ? Thanks!

uartie commented 1 year ago

You'll want to squash your changes into the original commit that is applied to your working branch (e.g. git rebase -i ...). Then use git format-patch .... Finally, copy the targeted patch into the patches directory, replacing the original. Maybe @xhaihao knows a more efficient way, but that is how I do it.