Skip to content

Add optimized gif support for decode_gif - #16804

Merged
jhseu merged 4 commits into
tensorflow:masterfrom
yongtang:15838-decode_gif-optimized
Feb 8, 2018
Merged

jhseu merged 4 commits into
tensorflow:masterfrom
yongtang:15838-decode_gif-optimized

Conversation

@yongtang

@yongtang yongtang commented Feb 6, 2018

Copy link
Copy Markdown
Member

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]

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]>
imgRight = std::min(imgRight, width);
imgBottom = std::min(imgBottom, height);

uint8* last_dst = dstdata + (k - 1) * width * channel * height;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jhseu
jhseu requested a review from rmlarsen February 7, 2018 22:21
imgRight = std::min(imgRight, width);
imgBottom = std::min(imgBottom, height);

uint8* last_dst = dstdata + (k - 1) * width * channel * height;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Feb 7, 2018
This commit add `#include <algorithm>` to fix
build errors on Windows platform.

Signed-off-by: Yong Tang <[email protected]>
@rmlarsen rmlarsen added kokoro:run kokoro:force-run Tests on submitted change and removed kokoro:run labels Feb 8, 2018
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Feb 8, 2018
@jhseu
jhseu merged commit f7f7036 into tensorflow:master Feb 8, 2018
@yongtang
yongtang deleted the 15838-decode_gif-optimized branch February 8, 2018 00:57
copybara-service Bot pushed a commit that referenced this pull request Sep 5, 2024
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
copybara-service Bot pushed a commit that referenced this pull request Sep 5, 2024
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
copybara-service Bot pushed a commit that referenced this pull request Sep 10, 2024
…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
copybara-service Bot pushed a commit that referenced this pull request Sep 10, 2024
…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
copybara-service Bot pushed a commit that referenced this pull request Sep 10, 2024
…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
copybara-service Bot pushed a commit that referenced this pull request Sep 10, 2024
…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
copybara-service Bot pushed a commit that referenced this pull request Sep 10, 2024
…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
copybara-service Bot pushed a commit that referenced this pull request Sep 10, 2024
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gif can't be decoded. InvalidArgumentError: Invalid GIF data

6 participants