Just like the Texans, the San Francisco 49ers were in a tough salary-cap situation this offseason. The 49ers helped themselves with an extension for defensive end Justin Smith last week.

Justin Smith’s role, age and ability could mean his contract provides benchmarks for Antonio Smith’s extension with the Texans. Both Smiths are skilled 3-4 defensive ends, disruptive and in their 30s. Antonio is 31, turning 32 in October, while Justin is 34.

Consider: Before making this deal, Justin Smith’s salary cap figure for 2013 was $8 million with a $7.5 million salary this season. Now the 49ers cut nearly $4.3 million off his cap figure while leaving his salary virtually unchanged for 2013. They gave him a minimum-base salary of $940,000 with a $6.56 million signing bonus and a $500,000 workout bonus.

Justin Smith’s cap number does rise to $6.737 million in 2014 and $6.237 million in 2015. But that isn’t astronomical. He’ll be paid $4.55 million in 2014 and $3.586 million in 2016 including base salary and roster bonuses, unless he gets released or retires.

Circling back to the Texans, as we’ve mentioned here before, Antonio Smith’s cap number is $9.5 million for 2013 including a $6 million base salary and $3.5 million in a pro-rated cap hit left over from his original deal in 2009 and a restructure in 2011.

The Texans have only $2.809 million available in cap space. They can fix this with an extension that would keep Antonio Smith in Houston for the rest of his career as he’s said he wants to be. Smith is coming off a seven-sack season, a career high, second on the team to J.J. Watt, who had a league-high 20.5.

If they gave Antonio Smith a four-year extension through 2017, they could lower his 2013 cap number significantly just by reducing his base salary to the minimum — $840,000 for someone with eight years experience — and making up the remaining $5.16 million in a signing bonus. He would receive the full signing bonus up front, thus not impacting his cash flow for the year, but the amount of the signing bonus that counts against the salary cap would be evenly split over the length of the contract.

That $3.5 million pro-rated amount from his original contract would still count in his cap number for 2013. But even carrying that number and adding it to the new pro-rated amount and his base salary, the Texans would reduce his cap figure by about $4 million with this plan.

Further, it wouldn’t create a mess toward the end of the contract. After 2013, the prorated amount stemming from his signing bonus would only be about $1 million. That would prevent too much dead money if the Texans released him with a year or two left on the contract.

Of course, to make this all work, they’ll have to agree on the base salaries for the rest of the contract, how much security in guarantees the Texans will be willing to give him and how much will make it worth it for him not to hit what’s become a soft market. Dwight Freeney only got a two-year deal worth $4.375 a year from San Diego. Only seven of the players ranked in the top 30 in average per year among defensive ends signed their deals while they were in their 30s. Freeney is the only one in that group who signed his deal while older than 31, and he is ranked 30th.

There will likely be a limit to how much Smith is willing to help. My sense, though, is both sides need each other enough that this gets done.

Once they’ve done this, the Texans can continue with their remaining offseason checklist: extending Brian Cushing, signing the rookies and possibly extending new starter Earl Mitchell. Cushing and Mitchell’s contracts are up after this season. They have yet to even start negotiating with first-round pick DeAndre Hopkins and still have D.J. Swearinger and Brennan Williams to sign, too.