[PR #564] [MERGED] Memory optimization in HARDSUBX edit_distance #1399

Closed
opened 2026-01-29 17:16:13 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/564
Author: @Izaron
Created: 12/22/2016
Status: Merged
Merged: 12/23/2016
Merged by: @cfsmp3

Base: masterHead: edit-distance-mem


📝 Commits (1)

  • 892edfe Memory optimization in edit_distance

📊 Changes

1 file changed (+29 additions, -14 deletions)

View changed files

📝 src/lib_ccx/hardsubx_utility.c (+29 -14)

📄 Description

I have made memory optimization in function edit_distance. This function is calls often in hardsubx, and works for O(len^2) time and O(len^2) memory. But in fact we can work with two massives with size len instead of len. With my commit it works now with massive with size of 2*min(len1,len2).
For example, in this two videos: https://abhinavshukla95.wordpress.com/2016/08/18/google-summer-of-code-work-product-submission/ We have maximum wasting of memory in first video 59x59 ints ans in second video 87x98 with example arguments. With my commit we can use memory of 2x59 ints and 2x87 ints respectively.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/CCExtractor/ccextractor/pull/564 **Author:** [@Izaron](https://github.com/Izaron) **Created:** 12/22/2016 **Status:** ✅ Merged **Merged:** 12/23/2016 **Merged by:** [@cfsmp3](https://github.com/cfsmp3) **Base:** `master` ← **Head:** `edit-distance-mem` --- ### 📝 Commits (1) - [`892edfe`](https://github.com/CCExtractor/ccextractor/commit/892edfe1528261531a1a65689b8e94bd077b671f) Memory optimization in edit_distance ### 📊 Changes **1 file changed** (+29 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `src/lib_ccx/hardsubx_utility.c` (+29 -14) </details> ### 📄 Description I have made memory optimization in function edit_distance. This function is calls often in hardsubx, and works for `O(len^2)` time and `O(len^2)` memory. But in fact we can work with **two** massives with size len instead of **len**. With my commit it works now with massive with size of 2*min(len1,len2). For example, in this two videos: https://abhinavshukla95.wordpress.com/2016/08/18/google-summer-of-code-work-product-submission/ We have maximum wasting of memory in first video 59x59 ints ans in second video 87x98 with example arguments. With my commit we can use memory of 2x59 ints and 2x87 ints respectively. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 17:16:13 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#1399