Repository navigation
Add optimized gif support for decode_gif - #16804
Conversation
While revisiting the issue of 15838, I noticed that currently optimized gif is not supported. However, optimized gif is actually possible to be processed as essentially the subsequent frame just adds the content on top of the previous frame on canvas. This fix adds the support for optimized gif with decode_gif. As is shown in the added test case, optimized gif (`optimized.gif`) could be handled the same way as original gif (`scan.gif`). This fix fixes 15838. Signed-off-by: Yong Tang <[email protected]>
Signed-off-by: Yong Tang <[email protected]>
Signed-off-by: Yong Tang <[email protected]>
| imgRight = std::min(imgRight, width); | ||
| imgBottom = std::min(imgBottom, height); | ||
|
|
||
| uint8* last_dst = dstdata + (k - 1) * width * channel * height; |
There was a problem hiding this comment.
This is an 100% optional suggestion—probably not worth doing—of which I have little understanding. But since matrix math is happening here, and "optimized" is in the PR title, just want to point out Tensor (based on Eigen) and better yet MKL e.g. mkl_matmul_op.cc (which unlike Eigen doesn't appear to be available in TF builds 100% of thte time) just in case you weren't already aware.
There was a problem hiding this comment.
Further note: We have some code in tensorflow/contrib/tensorboard/db/ that might duplicate this code, except probably not? since I think that only applies to encode and not decode.
There was a problem hiding this comment.
I'm not sure what TF builds @jart is referring to. I have a hard time imagining a TF build without Eigen, since many of the core classes like Tensor are thin wrappers over Eigen classes.
In any case, I don't see any matrix math with mentioning here.
| imgRight = std::min(imgRight, width); | ||
| imgBottom = std::min(imgBottom, height); | ||
|
|
||
| uint8* last_dst = dstdata + (k - 1) * width * channel * height; |
There was a problem hiding this comment.
I'm not sure what TF builds @jart is referring to. I have a hard time imagining a TF build without Eigen, since many of the core classes like Tensor are thin wrappers over Eigen classes.
In any case, I don't see any matrix math with mentioning here.
This commit add `#include <algorithm>` to fix build errors on Windows platform. Signed-off-by: Yong Tang <[email protected]>
Imported from GitHub PR openxla/xla#16804 This pass will be switched on again when #16569 gets resolved. Copybara import of the project: -- 3730c03404d3a06aa9e7f0eebb80572bd5903a02 by Shraiysh Vaishay <[email protected]>: Comment out PGLE accuracy checker. This pass will be switched on again when #16569 gets resolved. Merging this change closes #16804 FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#16804 from shraiysh:pgle_fix 3730c03404d3a06aa9e7f0eebb80572bd5903a02 PiperOrigin-RevId: 671080362
Imported from GitHub PR openxla/xla#16804 This pass will be switched on again when #16569 gets resolved. Copybara import of the project: -- 3730c03404d3a06aa9e7f0eebb80572bd5903a02 by Shraiysh Vaishay <[email protected]>: Comment out PGLE accuracy checker. This pass will be switched on again when #16569 gets resolved. Merging this change closes #16804 FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#16804 from shraiysh:pgle_fix 3730c03404d3a06aa9e7f0eebb80572bd5903a02 PiperOrigin-RevId: 671080362
…accuracy checker Imported from GitHub PR openxla/xla#16804 To enable the strict pgle accuracy checker, set `--xla_gpu_enable_pgle_accuracy_checker` in XLA_FLAGS Copybara import of the project: -- 932ac20717518a09042d4cea1d4699dc86d8287a by Shraiysh Vaishay <[email protected]>: Add flag for pgle_accuracy_checker Adding the flag `--xla_gpu_enable_pgle_accuracy_checker` for enabling PGLE accurcay checker. Merging this change closes #16804 FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#16804 from shraiysh:pgle_fix 932ac20717518a09042d4cea1d4699dc86d8287a PiperOrigin-RevId: 671080362
…accuracy checker Imported from GitHub PR openxla/xla#16804 To enable the strict pgle accuracy checker, set `--xla_gpu_enable_pgle_accuracy_checker` in XLA_FLAGS Copybara import of the project: -- 932ac20717518a09042d4cea1d4699dc86d8287a by Shraiysh Vaishay <[email protected]>: Add flag for pgle_accuracy_checker Adding the flag `--xla_gpu_enable_pgle_accuracy_checker` for enabling PGLE accurcay checker. Merging this change closes #16804 FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#16804 from shraiysh:pgle_fix 932ac20717518a09042d4cea1d4699dc86d8287a PiperOrigin-RevId: 672858045
…accuracy checker Imported from GitHub PR openxla/xla#16804 To enable the strict pgle accuracy checker, set `--xla_gpu_enable_pgle_accuracy_checker` in XLA_FLAGS Copybara import of the project: -- 932ac20717518a09042d4cea1d4699dc86d8287a by Shraiysh Vaishay <[email protected]>: Add flag for pgle_accuracy_checker Adding the flag `--xla_gpu_enable_pgle_accuracy_checker` for enabling PGLE accurcay checker. Merging this change closes #16804 FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#16804 from shraiysh:pgle_fix 932ac20717518a09042d4cea1d4699dc86d8287a PiperOrigin-RevId: 671080362
…accuracy checker Imported from GitHub PR openxla/xla#16804 To enable the strict pgle accuracy checker, set `--xla_gpu_enable_pgle_accuracy_checker` in XLA_FLAGS Copybara import of the project: -- 932ac20717518a09042d4cea1d4699dc86d8287a by Shraiysh Vaishay <[email protected]>: Add flag for pgle_accuracy_checker Adding the flag `--xla_gpu_enable_pgle_accuracy_checker` for enabling PGLE accurcay checker. Merging this change closes #16804 PiperOrigin-RevId: 672870336
…accuracy checker Imported from GitHub PR openxla/xla#16804 To enable the strict pgle accuracy checker, set `--xla_gpu_enable_pgle_accuracy_checker` in XLA_FLAGS Copybara import of the project: -- 932ac20717518a09042d4cea1d4699dc86d8287a by Shraiysh Vaishay <[email protected]>: Add flag for pgle_accuracy_checker Adding the flag `--xla_gpu_enable_pgle_accuracy_checker` for enabling PGLE accurcay checker. Merging this change closes #16804 FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#16804 from shraiysh:pgle_fix 932ac20717518a09042d4cea1d4699dc86d8287a PiperOrigin-RevId: 672858045
…accuracy checker Imported from GitHub PR openxla/xla#16804 To enable the strict pgle accuracy checker, set `--xla_gpu_enable_pgle_accuracy_checker` in XLA_FLAGS Copybara import of the project: -- 932ac20717518a09042d4cea1d4699dc86d8287a by Shraiysh Vaishay <[email protected]>: Add flag for pgle_accuracy_checker Adding the flag `--xla_gpu_enable_pgle_accuracy_checker` for enabling PGLE accurcay checker. Merging this change closes #16804 PiperOrigin-RevId: 672887004
While revisiting the issue of #15838, I noticed that currently optimized gif is not supported. However,
optimized gif is actually possible to be processed as essentially the subsequent frame just adds the content on top of the previous frame on canvas.
This fix adds the support for optimized gif with decode_gif.
As is shown in the added test case, optimized gif (
optimized.gif) could be handled the same way as original gif (scan.gif).This fix fixes #15838.
Signed-off-by: Yong Tang [email protected]